From 578c3a471efc2c275df447796db5881efd19e0f7 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 30 Aug 2010 18:53:04 +0200 Subject: Folder icons for local files --- src/iconmanager.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/iconmanager.cpp') diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp index 694af6a5..4381b53a 100644 --- a/src/iconmanager.cpp +++ b/src/iconmanager.cpp @@ -35,6 +35,8 @@ // KDE Includes #include #include +#include +#include // Qt Includes #include @@ -83,7 +85,12 @@ KIcon IconManager::iconForUrl(const KUrl &url) return KIcon(faviconDir + i); } kDebug() << "Icon NOT Found. returning text-html one"; - + + // TODO: return other mimetype icons + if(url.isLocalFile()) + { + return KIcon("folder"); + } return KIcon("text-html"); } @@ -95,6 +102,7 @@ void IconManager::provideIcon(QWebPage *page, const KUrl &url, bool notify) kDebug() << "URL: " << url << ". about scheme. Aborting..."; return; } + QUrl u(url.url()); QString rootUrlString = u.toString( QUrl::RemovePassword | QUrl::RemoveUserInfo -- cgit v1.2.1