diff options
| author | Rafael Fernández López <[email protected]> | 2007-07-01 15:45:55 +0000 |
|---|---|---|
| committer | Rafael Fernández López <[email protected]> | 2007-07-01 15:45:55 +0000 |
| commit | 2578bea1d8f58a2eaeac56e4782f4bfc816728af (patch) | |
| tree | 24e4e9c15d0128d5d01b26dd9617f5b195653b06 /src/klistview.cpp | |
| parent | ab3d8b100385fabaa612683f527d2e4ebd5c1086 (diff) | |
Define variables in their context
svn path=/trunk/KDE/kdebase/apps/; revision=682100
Diffstat (limited to 'src/klistview.cpp')
| -rw-r--r-- | src/klistview.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/klistview.cpp b/src/klistview.cpp index 347055df7..1e9e1b013 100644 --- a/src/klistview.cpp +++ b/src/klistview.cpp @@ -169,16 +169,14 @@ QRect KListView::Private::visualRectInViewport(const QModelIndex &index) const retRect.setLeft(retRect.left() + column * listView->spacing() + column * itemWidth); - float rows; - int rowsInt; foreach (const QString &category, categories) { if (category == curCategory) break; - rows = (float) ((float) categoriesIndexes[category].count() / - (float) elementsPerRow); - rowsInt = categoriesIndexes[category].count() / elementsPerRow; + float rows = (float) ((float) categoriesIndexes[category].count() / + (float) elementsPerRow); + int rowsInt = categoriesIndexes[category].count() / elementsPerRow; if (rows - trunc(rows)) rowsInt++; @@ -226,16 +224,14 @@ QRect KListView::Private::visualCategoryRectInViewport(const QString &category) if (!elementsPerRow) elementsPerRow++; - float rows; - int rowsInt; foreach (const QString &itCategory, categories) { if (itCategory == category) break; - rows = (float) ((float) categoriesIndexes[itCategory].count() / - (float) elementsPerRow); - rowsInt = categoriesIndexes[itCategory].count() / elementsPerRow; + float rows = (float) ((float) categoriesIndexes[itCategory].count() / + (float) elementsPerRow); + int rowsInt = categoriesIndexes[itCategory].count() / elementsPerRow; if (rows - trunc(rows)) rowsInt++; |
