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

List:       kde-commits
Subject:    KDE/kdelibs/solid/solid/backends/hal
From:       Ambroz Bizjak <ambro () b4ever ! net>
Date:       2008-10-30 18:48:37
Message-ID: 1225392517.214976.14906.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 877943 by abizjak:

Handle HAL alternative filesystem drivers. These should be supported
starting with HAL 0.5.12.
The preferred driver will always be used as configured with HAL;
there should be a way for  the user to choose another one, but device
configuration is not implemented in KDE4 yet.


 M  +20 -3     halstorageaccess.cpp  


--- trunk/KDE/kdelibs/solid/solid/backends/hal/halstorageaccess.cpp #877942:877943
@@ -268,9 +268,27 @@
     QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.Hal", udi,
                                                       "org.freedesktop.Hal.Device.Volume",
                                                       "Mount");
-    QStringList options;
+
+    // HAL 0.5.12 supports using alternative drivers for the same filesystem.
+    // This is mainly used to integrate the ntfs-3g driver.
+    // Unfortunately, the primary driver gets used unless we
+    // specify some other driver (fstype) to the Mount method.
+    // TODO: Allow the user to choose the driver.
+
+    QString fstype = m_device->property("volume.fstype").toString();
     QStringList halOptions = m_device->property("volume.mount.valid_options").toStringList();
 
+    QString alternativePreferred = m_device->property("volume.fstype.alternative.preferred").toString();
+    if (!alternativePreferred.isEmpty()) {
+        QStringList alternativeFstypes = m_device->property("volume.fstype.alternative").toStringList();
+        if (alternativeFstypes.contains(alternativePreferred)) {
+            fstype = alternativePreferred;
+            halOptions = m_device->property("volume.mount."+fstype+".valid_options").toStringList();
+        }
+    }
+
+    QStringList options;
+
 #ifdef Q_OS_FREEBSD
     QString uid="-u=";
 #else
@@ -280,7 +298,6 @@
         options << uid+QString::number(::getuid());
     }
 
-    QString fstype=m_device->property("volume.fstype").toString();
 #ifdef Q_OS_FREEBSD
     char *cType;
     if ( fstype=="vfat" && halOptions.contains("-L=")) {
@@ -309,7 +326,7 @@
     }
 #endif
 
-    msg << "" << "" << options;
+    msg << "" << fstype << options;
 
     return c.callWithCallback(msg, this,
                               SLOT(slotDBusReply(const QDBusMessage &)),
[prev in list] [next in list] [prev in thread] [next in thread] 

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