┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2008-05-28 22:59:26 +0000
committerDavid Faure <[email protected]>2008-05-28 22:59:26 +0000
commitd6fc21618accd6182c9fb913a9b31866e4a8aa20 (patch)
treed0016928ec2396125c25715c8c21f1b1625dbe02 /src
parentb2fb35585dfa3161ecbc1f5a1734c5dbac5abe8b (diff)
Wow, giving fileItem.url().url() to KFileMetaInfo is a bad idea -- it takes that as a path, so you end up with
QFile("file://fish://hostname")... I guess the only solution is to skip the whole KFileMetaInfo stuff for non-local-files. But then we shouldn't see size 0 modified 12:00 am... svn path=/trunk/KDE/kdebase/apps/; revision=813953
Diffstat (limited to 'src')
-rw-r--r--src/infosidebarpage.cpp40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/infosidebarpage.cpp b/src/infosidebarpage.cpp
index 002b1ffdd..d2201eb2b 100644
--- a/src/infosidebarpage.cpp
+++ b/src/infosidebarpage.cpp
@@ -314,26 +314,28 @@ void InfoSidebarPage::showMetaInfo()
m_metaTextLabel->add(i18nc("@label", "Size:"), KIO::convertSize(fileItem.size()));
m_metaTextLabel->add(i18nc("@label", "Modified:"), fileItem.timeString());
- // TODO: See convertMetaInfo below, find a way to display only interesting information
- // in a readable way
- const KFileMetaInfo::WhatFlags flags = KFileMetaInfo::Fastest |
- KFileMetaInfo::TechnicalInfo |
- KFileMetaInfo::ContentInfo |
- KFileMetaInfo::Thumbnail;
- const QString path = fileItem.url().url();
- const KFileMetaInfo fileMetaInfo(path, QString(), flags);
- if (fileMetaInfo.isValid()) {
- const QHash<QString, KFileMetaInfoItem>& items = fileMetaInfo.items();
- QHash<QString, KFileMetaInfoItem>::const_iterator it = items.constBegin();
- const QHash<QString, KFileMetaInfoItem>::const_iterator end = items.constEnd();
- QString labelText;
- while (it != end) {
- const KFileMetaInfoItem& metaInfoItem = it.value();
- const QVariant& value = metaInfoItem.value();
- if (value.isValid() && convertMetaInfo(metaInfoItem.name(), labelText)) {
- m_metaTextLabel->add(labelText, value.toString());
+ if (fileItem.isLocalFile()) {
+ // TODO: See convertMetaInfo below, find a way to display only interesting information
+ // in a readable way
+ const KFileMetaInfo::WhatFlags flags = KFileMetaInfo::Fastest |
+ KFileMetaInfo::TechnicalInfo |
+ KFileMetaInfo::ContentInfo |
+ KFileMetaInfo::Thumbnail;
+ const QString path = fileItem.url().path();
+ const KFileMetaInfo fileMetaInfo(path, QString(), flags);
+ if (fileMetaInfo.isValid()) {
+ const QHash<QString, KFileMetaInfoItem>& items = fileMetaInfo.items();
+ QHash<QString, KFileMetaInfoItem>::const_iterator it = items.constBegin();
+ const QHash<QString, KFileMetaInfoItem>::const_iterator end = items.constEnd();
+ QString labelText;
+ while (it != end) {
+ const KFileMetaInfoItem& metaInfoItem = it.value();
+ const QVariant& value = metaInfoItem.value();
+ if (value.isValid() && convertMetaInfo(metaInfoItem.name(), labelText)) {
+ m_metaTextLabel->add(labelText, value.toString());
+ }
+ ++it;
}
- ++it;
}
}
}