[PC-BSD Commits] r8223 - pcbsd/stable/SysInstaller

svn at pcbsd.org svn at pcbsd.org
Wed Dec 15 07:04:25 PST 2010


Author: kris
Date: 2010-12-15 07:04:25 -0800 (Wed, 15 Dec 2010)
New Revision: 8223

Modified:
   pcbsd/stable/SysInstaller/main.cpp
   pcbsd/stable/SysInstaller/sysinstaller.cpp
Log:

MFC fix to loading languages with () in description



Modified: pcbsd/stable/SysInstaller/main.cpp
===================================================================
--- pcbsd/stable/SysInstaller/main.cpp	2010-12-15 15:03:32 UTC (rev 8222)
+++ pcbsd/stable/SysInstaller/main.cpp	2010-12-15 15:04:25 UTC (rev 8223)
@@ -39,6 +39,7 @@
         a.installTranslator(&translator);
         qDebug() << "Loaded Translation:" << appDir + "/i18n/SysInstaller_" + langCode + ".qm";
       } else {
+        qDebug() << "Could not find: " << appDir + "/i18n/SysInstaller_" + langCode + ".qm";
         langCode = "";
       }
 
@@ -71,8 +72,9 @@
          QFile lfile(TMPLANGFILE);
          if (!lfile.open(QIODevice::ReadOnly | QIODevice::Text))
            return 150;
-         while (!lfile.atEnd())
-           changeLang = lfile.readLine();
+         changeLang = lfile.readLine();
+	 lfile.close();
+	 qDebug() << "Language switch requested for:" << changeLang;
          QFile::remove(TMPLANGFILE);
       } else {
         break;

Modified: pcbsd/stable/SysInstaller/sysinstaller.cpp
===================================================================
--- pcbsd/stable/SysInstaller/sysinstaller.cpp	2010-12-15 15:03:32 UTC (rev 8222)
+++ pcbsd/stable/SysInstaller/sysinstaller.cpp	2010-12-15 15:04:25 UTC (rev 8223)
@@ -394,9 +394,11 @@
 
     // Figure out the language code
     QString langCode = languages.at(comboLanguage->currentIndex());
-    langCode.truncate(langCode.indexOf(")"));
-    langCode.remove(0, langCode.indexOf("(") + 1);
 
+    // Grab the language code
+    langCode.truncate(langCode.lastIndexOf(")"));
+    langCode.remove(0, langCode.lastIndexOf("(") + 1);
+
     // Now write out the lang code and close
     QFile lfile( TMPLANGFILE );
     if ( lfile.open( QIODevice::WriteOnly ) ) {



More information about the Commits mailing list