]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/infosidebarpage.cpp
SVN_SILENT: minor coding style fixes
[dolphin.git] / src / infosidebarpage.cpp
index 4716ea2d594369628353904d51d62aeab479654d..7b0d2d40c2109cdd7c13fdab78995f3842698bc8 100644 (file)
@@ -80,6 +80,7 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
     m_infoLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
     m_infoLabel->setTextFormat(Qt::RichText);
     m_infoLabel->setWordWrap(true);
+    m_infoLabel->setFont(KGlobalSettings::smallestReadableFont());
 
     if (MetaDataWidget::metaDataAvailable()) {
         m_metadataWidget = new MetaDataWidget(this);
@@ -90,8 +91,8 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
     layout->addWidget(m_nameLabel);
     layout->addWidget(new KSeparator(this));
     layout->addWidget(m_infoLabel);
-    layout->addWidget(new KSeparator(this));
-    if (m_metadataWidget) {
+    if (m_metadataWidget != 0) {
+        layout->addWidget(new KSeparator(this));
         layout->addWidget(m_metadataWidget);
     }
     // ensure that widgets in the information side bar are aligned towards the top
@@ -188,7 +189,7 @@ void InfoSidebarPage::showItemInfo()
     const int itemCount = selectedItems.count();
     if (itemCount > 1) {
         KIconLoader iconLoader;
-        QPixmap icon = iconLoader.loadIcon("exec",
+        QPixmap icon = iconLoader.loadIcon("system-run",
                                            KIconLoader::NoGroup,
                                            KIconLoader::SizeEnormous);
         m_preview->setPixmap(icon);
@@ -332,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));
     }