[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/solid/solid/backends/hal
From: Nickolai Shaforostoff <shafff () ukr ! net>
Date: 2008-10-06 18:21:55
Message-ID: 1223317315.158318.17251.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 868600 by shaforo:
-apply patch for BSD suggested by makc .at. issp.ac.ru
-it was studied out that passing 'utf8' option on linux is enough
for proper vfat (and hopefully iso9660 and udf)
w/o specifying source charset is enough
M +30 -15 halstorageaccess.cpp
--- trunk/KDE/kdelibs/solid/solid/backends/hal/halstorageaccess.cpp #868599:868600
@@ -267,28 +267,27 @@
QStringList options;
QStringList halOptions = m_device->property("volume.mount.valid_options").toStringList();
- if (halOptions.contains("uid=")) {
- options << "uid="+QString::number(::getuid());
+#ifdef Q_OS_FREEBSD
+ QString uid="-u=";
+#else
+ QString uid="uid=";
+#endif
+ if (halOptions.contains(uid)) {
+ options << uid+QString::number(::getuid());
}
+
+ QString fstype=m_device->property("volume.fstype").toString();
//respect Microsoft Windows-enforced charsets for fat
- if ( m_device->property("volume.fstype").toString()=="vfat" ) {
- bool linuxMount=halOptions.contains("codepage=");
- bool bsdMount=halOptions.contains("-D=");
+#ifdef Q_OS_FREEBSD
+ if ( fstype=="vfat" ) {
QString codepage;
QString iocharset;
- if (linuxMount)
- {
- codepage="codepage=";
- iocharset="iocharset=utf8";
- }
- else if (bsdMount)
- {
+ if (halOptions.contains("-D=")) {
codepage="-D=CP";
iocharset="-L="+QLocale::system().name()+".UTF-8";
}
- if (linuxMount||bsdMount)
- {
+ if (!codepage.isEmpty()) {
switch (QLocale::system().language()) {
case QLocale::Russian:
case QLocale::Ukrainian:
@@ -343,10 +342,12 @@
options << iocharset;
}
}
+
}
+#endif
// 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=") ) {
+ if ( fstype.startsWith("ntfs") && halOptions.contains("locale=") ) {
// have to obtain LC_CTYPE as returned by the `locale` command
// check in the same order as `locale` does
char *cType;
@@ -355,6 +356,20 @@
}
}
+#ifdef Q_OS_FREEBSD
+ if ( fstype.startsWith("ntfs") || fstype=="iso9660" || fstype=="udf" ) {
+ if (halOptions.contains("-C="))
+ options << "-C=UTF-8";
+ }
+#else
+ if ( /*fstype.startsWith("ntfs") ||*/ fstype=="iso9660" || fstype=="udf" || fstype=="vfat" ) {
+ if (halOptions.contains("utf8"))
+ options<<"utf8";
+ else if (halOptions.contains("iocharset="))
+ options<<"iocharset=utf8";
+ }
+#endif
+
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