[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.5/kdelibs/kio/kio
From: David Faure <faure () kde ! org>
Date: 2010-10-22 19:17:28
Message-ID: 20101022191729.05C30AC897 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1188632 by dfaure:
Backport r1188630: Use "emblem-mounted" to show mounted devices, looks better than the old
UnmountIcon/Icon solution.
M +11 -13 kfileitem.cpp
--- branches/KDE/4.5/kdelibs/kio/kio/kfileitem.cpp #1188631:1188632
@@ -742,21 +742,10 @@
static QString iconFromDesktopFile(const QString& path)
{
KDesktopFile cfg( path );
- const KConfigGroup group = cfg.desktopGroup();
const QString icon = cfg.readIcon();
+ if ( cfg.hasLinkType() ) {
+ const KConfigGroup group = cfg.desktopGroup();
const QString type = cfg.readPath();
-
- if ( cfg.hasDeviceType() )
- {
- const QString unmount_icon = group.readEntry( "UnmountIcon" );
- const QString dev = cfg.readDevice();
- if ( !icon.isEmpty() && !unmount_icon.isEmpty() && !dev.isEmpty() )
- {
- KMountPoint::Ptr mountPoint = KMountPoint::currentMountPoints().findByDevice(dev);
- if (!mountPoint) // not mounted?
- return unmount_icon;
- }
- } else if ( cfg.hasLinkType() ) {
const QString emptyIcon = group.readEntry( "EmptyIcon" );
if ( !emptyIcon.isEmpty() ) {
const QString u = cfg.readUrl();
@@ -853,7 +842,16 @@
if ( group.hasKey( "Exec" ) && !KDesktopFile::isAuthorizedDesktopFile( localPath() ) ) {
names.append( "emblem-important" );
}
+
+ if (cfg.hasDeviceType()) {
+ const QString dev = cfg.readDevice();
+ if (!dev.isEmpty()) {
+ KMountPoint::Ptr mountPoint = KMountPoint::currentMountPoints().findByDevice(dev);
+ if (mountPoint) // mounted?
+ names.append("emblem-mounted");
}
+ }
+ }
if ( isHidden() ) {
names.append("hidden");
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic