[PC-BSD Commits] r4766 - pcbsd/trunk/kcmSoftwareManagerLauncher

svn at pcbsd.org svn at pcbsd.org
Mon Oct 26 08:52:03 PST 2009


Author: kris
Date: 2009-10-26 09:52:02 -0700 (Mon, 26 Oct 2009)
New Revision: 4766

Added:
   pcbsd/trunk/kcmSoftwareManagerLauncher/pcbsdpbm.desktop
Removed:
   pcbsd/trunk/kcmSoftwareManagerLauncher/PBM_en.ts
Modified:
   pcbsd/trunk/kcmSoftwareManagerLauncher/kcm.cpp
   pcbsd/trunk/kcmSoftwareManagerLauncher/kcmSML.pro
   pcbsd/trunk/kcmSoftwareManagerLauncher/notroot.cpp
   pcbsd/trunk/kcmSoftwareManagerLauncher/notroot.h
Log:

Updated SML to make i18n during install, and load it properly



Modified: pcbsd/trunk/kcmSoftwareManagerLauncher/kcm.cpp
===================================================================
--- pcbsd/trunk/kcmSoftwareManagerLauncher/kcm.cpp	2009-10-26 16:46:19 UTC (rev 4765)
+++ pcbsd/trunk/kcmSoftwareManagerLauncher/kcm.cpp	2009-10-26 16:52:02 UTC (rev 4766)
@@ -3,10 +3,11 @@
 
 #include <klocale.h>
 #include <kglobal.h>
+#include <kapplication.h>
 #include <kgenericfactory.h>
 #include "notroot.h"
 #include <kcm.h>
-#include <qtranslator.h>
+#include <QTranslator>
 
 K_PLUGIN_FACTORY(PCBSDPBMFactory, 
                  registerPlugin<PCBSDPBM>();
@@ -17,6 +18,12 @@
    :    KCModule(PCBSDPBMFactory::componentData(), parent, lst)
 {
   layout = new QGridLayout(this);
+
+  QString locale = KGlobal::locale()->language();
+  QTranslator translator;
+  translator.load(QString("kcmSML_") + locale, "/usr/local/kde4/share/apps/pcbsd/i18n/");
+  KApplication::installTranslator(&translator);
+
   
   buttons();
   

Modified: pcbsd/trunk/kcmSoftwareManagerLauncher/kcmSML.pro
===================================================================
--- pcbsd/trunk/kcmSoftwareManagerLauncher/kcmSML.pro	2009-10-26 16:46:19 UTC (rev 4765)
+++ pcbsd/trunk/kcmSoftwareManagerLauncher/kcmSML.pro	2009-10-26 16:52:02 UTC (rev 4766)
@@ -78,6 +78,14 @@
 		i18n/kcmSML_zh_TW.ts \
 		i18n/kcmSML_zu.ts
 
+desktop.path=/usr/local/kde4/share/kde4/services/
+desktop.files=pcbsdpbm.desktop
+
+dotrans.path=/usr/local/kde4/share/apps/pcbsd/i18n/
+dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/kde4/share/apps/pcbsd/i18n/
+
+INSTALLS += dotrans desktop
+
 INCLUDEPATH     += /usr/PCBSD/includes /usr/local/kde4/include
 
 QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib

Modified: pcbsd/trunk/kcmSoftwareManagerLauncher/notroot.cpp
===================================================================
--- pcbsd/trunk/kcmSoftwareManagerLauncher/notroot.cpp	2009-10-26 16:46:19 UTC (rev 4765)
+++ pcbsd/trunk/kcmSoftwareManagerLauncher/notroot.cpp	2009-10-26 16:52:02 UTC (rev 4766)
@@ -1,6 +1,8 @@
 #include <QTextStream>
 #include <QPixmap>
 #include <QTimer>
+#include <kglobal.h>
+#include <klocale.h>
 /***************************************************************************
  *   Copyright (C) 2006 - 2008 PC-BSD Software   *
  *   kris at pcbsd.com  *
@@ -39,11 +41,11 @@
 void NotRoot::slotLaunchAdmin()
 {
     // Launch the kcmshell4 process as root
-    launchAdminProc = new QProcess( this );
-    QString prog = "kdesu";
-    QStringList args;
-    args << "pcSoftwareManager";
-    launchAdminProc->start(prog, args);
+    QString locale = KGlobal::locale()->language();
+
+    QString prog = "kdesu 'pcSoftwareManager' &";
+    system( prog.toLatin1() );
+
 }
 
 

Modified: pcbsd/trunk/kcmSoftwareManagerLauncher/notroot.h
===================================================================
--- pcbsd/trunk/kcmSoftwareManagerLauncher/notroot.h	2009-10-26 16:46:19 UTC (rev 4765)
+++ pcbsd/trunk/kcmSoftwareManagerLauncher/notroot.h	2009-10-26 16:52:02 UTC (rev 4766)
@@ -25,7 +25,6 @@
 	void slotLaunchAdmin();
 
 private:
-	QProcess *launchAdminProc;
 
 signals:
 



More information about the Commits mailing list