]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix discrepancy in total size between statusbar and infosidebarpage; reported by...
authorDavid Faure <faure@kde.org>
Tue, 18 Dec 2007 18:13:31 +0000 (18:13 +0000)
committerDavid Faure <faure@kde.org>
Tue, 18 Dec 2007 18:13:31 +0000 (18:13 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=750121

src/infosidebarpage.cpp

index bed20b1f5942905fade68b191947e43065634dad..7b0d2d40c2109cdd7c13fdab78995f3842698bc8 100644 (file)
@@ -333,9 +333,10 @@ void InfoSidebarPage::showMetaInfo()
 
         unsigned long int totalSize = 0;
         foreach (const KFileItem& item, selectedItems) {
-            // TODO: what to do with directories (same with the one-item-selected-code)?,
-            // item.size() does not return the size of the content : not very instinctive for users
-            totalSize += item.size();
+            // Only count the size of files, not dirs; to match what
+            // DolphinViewContainer::selectionStatusBarText does.
+            if (!item.isDir() && !item.isLink())
+                totalSize += item.size();
         }
         addInfoLine(text, i18nc("@label", "Total size:"), KIO::convertSize(totalSize));
     }