[PC-BSD Commits] r8222 - pcbsd/current/src-qt4/pc-sysinstaller

svn at pcbsd.org svn at pcbsd.org
Wed Dec 15 07:03:32 PST 2010


Author: kris
Date: 2010-12-15 07:03:32 -0800 (Wed, 15 Dec 2010)
New Revision: 8222

Modified:
   pcbsd/current/src-qt4/pc-sysinstaller/main.cpp
   pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.cpp
Log:

Fixed bugs loading languages which have () in the description



Modified: pcbsd/current/src-qt4/pc-sysinstaller/main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysinstaller/main.cpp	2010-12-15 14:15:07 UTC (rev 8221)
+++ pcbsd/current/src-qt4/pc-sysinstaller/main.cpp	2010-12-15 15:03:32 UTC (rev 8222)
@@ -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/current/src-qt4/pc-sysinstaller/sysinstaller.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.cpp	2010-12-15 14:15:07 UTC (rev 8221)
+++ pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.cpp	2010-12-15 15:03:32 UTC (rev 8222)
@@ -447,8 +447,10 @@
 
     // 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 );



More information about the Commits mailing list