]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/infosidebarpage.cpp
Only browse through zip and tar files if they are local (otherwise a cryptic error...
[dolphin.git] / src / infosidebarpage.cpp
index 8ef1d3525f55434cbacf9c53cb80a41357c9be5a..bed20b1f5942905fade68b191947e43065634dad 100644 (file)
@@ -77,8 +77,10 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
 
     // general information
     m_infoLabel = new QLabel(this);
-    m_infoLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+    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);
@@ -89,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
@@ -118,7 +120,7 @@ void InfoSidebarPage::setUrl(const KUrl& url)
     }
 }
 
-void InfoSidebarPage::setSelection(const QList<KFileItem>& selection)
+void InfoSidebarPage::setSelection(const KFileItemList& selection)
 {
     SidebarPage::setSelection(selection);
     if (selection.size() == 1) {
@@ -173,7 +175,7 @@ void InfoSidebarPage::showItemInfo()
 
     cancelRequest();
 
-    const QList<KFileItem>& selectedItems = selection();
+    const KFileItemList& selectedItems = selection();
 
     KUrl file;
     if (selectedItems.isEmpty()) {
@@ -187,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);
@@ -279,7 +281,7 @@ void InfoSidebarPage::showMetaInfo()
 {
     QString text;
 
-    const QList<KFileItem>& selectedItems = selection();
+    const KFileItemList& selectedItems = selection();
     if (selectedItems.size() <= 1) {
         KFileItem fileItem(S_IFDIR, KFileItem::Unknown, m_shownUrl);
         fileItem.refresh();
@@ -295,7 +297,12 @@ void InfoSidebarPage::showMetaInfo()
 
             // TODO: See convertMetaInfo below, find a way to display only interesting information
             // in a readable way
-            const KFileMetaInfo metaInfo(fileItem.url());
+            const KFileMetaInfo::WhatFlags flags = KFileMetaInfo::Fastest |
+                                                   KFileMetaInfo::TechnicalInfo |
+                                                   KFileMetaInfo::ContentInfo |
+                                                   KFileMetaInfo::Thumbnail;
+            const QString path = fileItem.url().url();
+            const KFileMetaInfo metaInfo(path, QString(), flags);
             if (metaInfo.isValid()) {
                 const QHash<QString, KFileMetaInfoItem>& items = metaInfo.items();
                 QHash<QString, KFileMetaInfoItem>::const_iterator it = items.constBegin();