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

List:       kde-commits
Subject:    branches/KDE/3.5/kdebase/kioslave/media/mediamanager
From:       Ambroz Bizjak <ambro () b4ever ! net>
Date:       2008-09-26 8:55:26
Message-ID: 1222419326.092295.8391.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 864963 by abizjak:

Fix the passing the 'locale' mount option:
- read the real locale from the environment (including the charset), the language is \
                of no use to FS drivers,
- do not attempt to store the locale in the config file, it has to be the current \
                one,
- only pass the locale if the filesystem type is ntfs-3g, HAL is broken and lists \
'locale' as available with the Linux  in-kernel ntfs driver \
(http://bugs.freedesktop.org/show_bug.cgi?id=17753)


 M  +17 -17    halbackend.cpp  


--- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/halbackend.cpp \
#864962:864963 @@ -851,13 +851,6 @@
         result << tmp;
     }
 
-	if ( valids.contains("locale") )
-	{
-		value = config.readBoolEntry( "locale", true );
-		tmp = QString( "locale=%1" ).arg( value ? "true" : "false" );
-		result << tmp;
-	}
-
     if (valids.contains("utf8"))
     {
         value = config.readBoolEntry("utf8", true);
@@ -878,6 +871,17 @@
             result << "shortname=lower";
     }
 
+    // pass our locale to the ntfs-3g driver so it can translate local characters
+    if (valids.contains("locale") && fstype == "ntfs-3g")
+    {
+        // 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")) ) { +            result << QString("locale=%1").arg(cType);
+        }
+    }
+
     if (valids.contains("sync"))
     {
         value = config.readBoolEntry("sync", ( valids.contains("flush") && \
!fstype.endsWith("fat") ) && removable); @@ -931,7 +935,7 @@
 
     QMap<QString,QString> valids = MediaManagerUtils::splitOptions(options);
 
-    const char *names[] = { "ro", "quiet", "atime", "uid", "utf8", "flush", "sync", \
"locale", 0 }; +    const char *names[] = { "ro", "quiet", "atime", "uid", "utf8", \
"flush", "sync", 0 };  for (int index = 0; names[index]; ++index)
         if (valids.contains(names[index]))
             config.writeEntry(names[index], valids[names[index]] == "true");
@@ -951,10 +955,6 @@
         config.writeEntry("automount", valids["automount"]);
     }
 
-	if (valids.contains("locale") ) {
-		config.writeEntry("locale", valids["locale"]);
-	}
-
     return true;
 }
 
@@ -1153,11 +1153,6 @@
         soptions << QString("uid=%1").arg(getuid());
     }
 
-    if (valids["locale"] == "true")
-	{
-		soptions << QString("locale=%1").arg( KGlobal::locale()->language() ); 
-	}
-
     if (valids["ro"] == "true")
         soptions << "ro";
 
@@ -1182,6 +1177,11 @@
         soptions << QString("shortname=%1").arg(valids["shortname"]);
     }
 
+    if (valids.contains("locale"))
+    {
+        soptions << QString("locale=%1").arg(valids["locale"]);
+    }
+
     if (valids.contains("journaling"))
     {
         QString option = valids["journaling"];


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

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