mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: kFolderIconName() function optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
678417ea8d
commit
8b9fc25d48
1 changed files with 3 additions and 4 deletions
|
@ -30,7 +30,6 @@
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
#include <kprotocolinfo.h>
|
#include <kprotocolinfo.h>
|
||||||
#include <kprotocolinfofactory.h>
|
#include <kprotocolinfofactory.h>
|
||||||
#include <kstandarddirs.h>
|
|
||||||
#include <kurl.h>
|
#include <kurl.h>
|
||||||
#include <kdesktopfile.h>
|
#include <kdesktopfile.h>
|
||||||
#include <kconfiggroup.h>
|
#include <kconfiggroup.h>
|
||||||
|
@ -83,9 +82,9 @@ static QString kFolderIconName(const KUrl &_url)
|
||||||
u.addPath(QString::fromLatin1(".directory"));
|
u.addPath(QString::fromLatin1(".directory"));
|
||||||
|
|
||||||
QString icon;
|
QString icon;
|
||||||
// using KStandardDirs as this one checks for path being
|
// .directory has to be a readable file
|
||||||
// a file instead of a directory
|
QFileInfo uinfo(u.toLocalFile());
|
||||||
if (KGlobal::dirs()->exists(u.toLocalFile())) {
|
if (uinfo.isFile() && uinfo.isReadable()) {
|
||||||
KDesktopFile cfg(u.toLocalFile());
|
KDesktopFile cfg(u.toLocalFile());
|
||||||
KConfigGroup group = cfg.desktopGroup();
|
KConfigGroup group = cfg.desktopGroup();
|
||||||
icon = group.readEntry("Icon");
|
icon = group.readEntry("Icon");
|
||||||
|
|
Loading…
Add table
Reference in a new issue