[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-09-24 0:12:03
Message-ID: 1222215123.763589.8266.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 864123 by abizjak:

Pass the user's locale to HAL when using the ntfs-3g driver.
If ntfs-3g is not provided a locale, it will fail to show any files
with non-ascii characters in the name, and fail to create such files.


 M  +11 -0     halstorageaccess.cpp  


--- trunk/KDE/kdelibs/solid/solid/backends/hal/halstorageaccess.cpp #864122:864123
@@ -31,6 +31,7 @@
 #include <QtGui/QWidget>
 
 #include <unistd.h>
+#include <stdlib.h>
 
 using namespace Solid::Backends::Hal;
 
@@ -334,6 +335,16 @@
         }
     }
 
+    // pass our locale to the ntfs-3g driver so it can translate local characters
+    if ( m_device->property("volume.fstype").toString()=="ntfs-3g" && halOptions.contains("locale=") ) {
+        // have to obtain LC_CTYPE as returned by the `locale` command
+        // check in the same order as `locale` does
+        char *cType;
+        if ( (cType = getenv("LC_ALL")) || (cType = getenv("LC_CTYPE")) || (cType = getenv("LANG")) ) {
+            options << "locale="+QString(cType);
+        }
+    }
+
     msg << "" << "" << options;
 
     return c.callWithCallback(msg, this,
[prev in list] [next in list] [prev in thread] [next in thread] 

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