diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2013-06-16 10:04:18 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2013-06-16 10:04:18 +0200 |
commit | 75a34a5e697e35c0da486c6c6f0e52107d8c8546 (patch) | |
tree | 9ec3b4d1e2e783555c1741060fae215b98b58e04 /src/icons | |
parent | Restore use of webkit icon cache (diff) | |
download | rekonq-75a34a5e697e35c0da486c6c6f0e52107d8c8546.tar.xz |
Manage local mimetype icons
Diffstat (limited to 'src/icons')
-rw-r--r-- | src/icons/iconmanager.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/icons/iconmanager.cpp b/src/icons/iconmanager.cpp index d7c0b170..1fa4f662 100644 --- a/src/icons/iconmanager.cpp +++ b/src/icons/iconmanager.cpp @@ -36,6 +36,7 @@ #include <KIO/Job> #include <KIcon> +#include <KFileItem> #include <KStandardDirs> #include <KUrl> @@ -96,7 +97,9 @@ KIcon IconManager::iconForUrl(const KUrl &url) // TODO: return other mimetype icons if (url.isLocalFile()) { - return KIcon("folder"); + KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url); + QString iconName = item.iconName(); + return KIcon(iconName); } QIcon icon = QWebSettings::iconForUrl(url); @@ -179,10 +182,11 @@ QString IconManager::iconPathForUrl(const KUrl &url) return icon; } - // TODO: return other mimetype icons if (url.isLocalFile()) { - QString icon = QL1S("file://") + KGlobal::dirs()->findResource("icon", "oxygen/16x16/places/folder.png"); + KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url); + QString iconName = item.iconName(); + QString icon = QString("file://") + KIconLoader::global()->iconPath(iconName, KIconLoader::Small); return icon; } |