[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kio/kio
From:       David Faure <faure () kde ! org>
Date:       2010-10-22 19:13:44
Message-ID: 20101022191344.46FB8AC897 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1188630 by dfaure:

Use "emblem-mounted" to show mounted devices, looks better than the old UnmountIcon/Icon solution.
CCBUGS: 172023 251156


 M  +11 -13    kfileitem.cpp  


--- trunk/KDE/kdelibs/kio/kio/kfileitem.cpp #1188629:1188630
@@ -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