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

List:       kde-commits
Subject:    KDE/kdelibs/solid/solid/backends/hal
From:       Kevin Ottens <ervin () kde ! org>
Date:       2008-09-27 14:33:14
Message-ID: 1222525994.296593.32486.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 865415 by ervin:

Find mountpoints for unmounted devices in our fstab cache just in case.
This way we can apply the "ignore" rule properly and avoid showing the
/boot partition of some users when it's not mounted.

BTW, I just noticed this was sitting on my laptop since Akademy 2008...
About time I commit it.

BUG: 169981




 M  +8 -0      halfstabhandling.cpp  
 M  +1 -0      halfstabhandling.h  
 M  +11 -1     halstorageaccess.cpp  
 M  +2 -2      halvolume.cpp  


--- trunk/KDE/kdelibs/solid/solid/backends/hal/halfstabhandling.cpp #865414:865415
@@ -136,6 +136,14 @@
     return globalMountPointsCache->contains(deviceToFind);
 }
 
+QStringList Solid::Backends::Hal::FstabHandling::possibleMountPoints(const QString &device)
+{
+    _k_updateMountPointsCache();
+    const QString deviceToFind = _k_resolveSymLink(device);
+
+    return globalMountPointsCache->values(deviceToFind);
+}
+
 QProcess *Solid::Backends::Hal::FstabHandling::callSystemCommand(const QString &commandName,
                                                                  const QString &device,
                                                                  QObject *obj, const char *slot)
--- trunk/KDE/kdelibs/solid/solid/backends/hal/halfstabhandling.h #865414:865415
@@ -35,6 +35,7 @@
 {
 public:
     static bool isInFstab(const QString &device);
+    static QStringList possibleMountPoints(const QString &device);
     static QProcess *callSystemCommand(const QString &commandName,
                                        const QString &device,
                                        QObject *obj, const char *slot);
--- trunk/KDE/kdelibs/solid/solid/backends/hal/halstorageaccess.cpp #865414:865415
@@ -74,7 +74,17 @@
 
 QString StorageAccess::filePath() const
 {
-    return m_device->property("volume.mount_point").toString();
+    QString result = m_device->property("volume.mount_point").toString();
+
+    if (result.isEmpty()) {
+        QStringList mountpoints
+            = FstabHandling::possibleMountPoints(m_device->property("block.device").toString());
+        if (mountpoints.size()==1) {
+            result = mountpoints.first();
+        }
+    }
+
+    return result;
 }
 
 
--- trunk/KDE/kdelibs/solid/solid/backends/hal/halvolume.cpp #865414:865415
@@ -18,6 +18,7 @@
 */
 
 #include "halvolume.h"
+#include "halstorageaccess.h"
 
 using namespace Solid::Backends::Hal;
 
@@ -44,12 +45,11 @@
      * are useless to him.
      */
     HalDevice drive(m_device->property("block.storage_device").toString());
-    QString mount_point = m_device->property("volume.mount_point").toString();
+    QString mount_point = StorageAccess(m_device).filePath();
     bool mounted = m_device->property("volume.is_mounted").toBool();
     bool removable = drive.property("storage.removable").toBool();
     bool hotpluggable = drive.property("storage.hotpluggable").toBool();
 
-
     return !removable && !hotpluggable
         && mounted && !mount_point.startsWith("/media/")
         && !mount_point.startsWith("/mnt/");
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic