[PC-BSD Commits] r4769 - pcbsd/trunk/kcmUserManagerLauncher

svn at pcbsd.org svn at pcbsd.org
Mon Oct 26 08:58:07 PST 2009


Author: kris
Date: 2009-10-26 09:58:07 -0700 (Mon, 26 Oct 2009)
New Revision: 4769

Added:
   pcbsd/trunk/kcmUserManagerLauncher/pcbsdusermanager.desktop
Removed:
   pcbsd/trunk/kcmUserManagerLauncher/kcm_pcbsdusermanager.desktop
Modified:
   pcbsd/trunk/kcmUserManagerLauncher/kcm.cpp
   pcbsd/trunk/kcmUserManagerLauncher/kcmUML.pro
   pcbsd/trunk/kcmUserManagerLauncher/notroot.cpp
   pcbsd/trunk/kcmUserManagerLauncher/notroot.h
Log:

Updated kcmUML to setup i18n automatically and add services file



Modified: pcbsd/trunk/kcmUserManagerLauncher/kcm.cpp
===================================================================
--- pcbsd/trunk/kcmUserManagerLauncher/kcm.cpp	2009-10-26 16:56:46 UTC (rev 4768)
+++ pcbsd/trunk/kcmUserManagerLauncher/kcm.cpp	2009-10-26 16:58:07 UTC (rev 4769)
@@ -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,11 @@
    :    KCModule(PCBSDPBMFactory::componentData(), parent, lst)
 {
   layout = new QGridLayout(this);
+
+  QString locale = KGlobal::locale()->language();
+  QTranslator translator;
+  translator.load(QString("kcmUML_") + locale, "/usr/local/kde4/share/apps/pcbsd/i18n/");
+  KApplication::installTranslator(&translator);
   
   buttons();
   

Modified: pcbsd/trunk/kcmUserManagerLauncher/kcmUML.pro
===================================================================
--- pcbsd/trunk/kcmUserManagerLauncher/kcmUML.pro	2009-10-26 16:56:46 UTC (rev 4768)
+++ pcbsd/trunk/kcmUserManagerLauncher/kcmUML.pro	2009-10-26 16:58:07 UTC (rev 4769)
@@ -80,12 +80,15 @@
 		i18n/kcmUML_zh_TW.ts \
 		i18n/kcmUML_zu.ts
 
-desktop.path=/usr/local/kde4/share/applications/kde4/
-desktop.files=kcm_pcbsdusermanager.desktop
+desktop.path=/usr/local/kde4/share/kde4/services/
+desktop.files=pcbsdusermanager.desktop
 
 kcm.path=/usr/local/kde4/lib/kde4/
 kcm.extra=ln -fs libkcm_pcbsdusermanager.so.1.0.0 /usr/local/kde4/lib/kde4/kcm_pcbsdusermanager.so
 
-INSTALLS += desktop kcm
+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 kcm
+
 QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib

Modified: pcbsd/trunk/kcmUserManagerLauncher/notroot.cpp
===================================================================
--- pcbsd/trunk/kcmUserManagerLauncher/notroot.cpp	2009-10-26 16:56:46 UTC (rev 4768)
+++ pcbsd/trunk/kcmUserManagerLauncher/notroot.cpp	2009-10-26 16:58:07 UTC (rev 4769)
@@ -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  *
@@ -38,12 +40,9 @@
 
 void NotRoot::slotLaunchAdmin()
 {
-    // Launch the kcmshell4 process as root
-    launchAdminProc = new QProcess( this );
-    QString prog = "kdesu";
-    QStringList args;
-    args << "pcUserManager";
-    launchAdminProc->start(prog, args);
+    QString locale = KGlobal::locale()->language();
+    QString prog = "kdesu 'pcUserManager' &";
+    system( prog.toLatin1() );
 }
 
 

Modified: pcbsd/trunk/kcmUserManagerLauncher/notroot.h
===================================================================
--- pcbsd/trunk/kcmUserManagerLauncher/notroot.h	2009-10-26 16:56:46 UTC (rev 4768)
+++ pcbsd/trunk/kcmUserManagerLauncher/notroot.h	2009-10-26 16:58:07 UTC (rev 4769)
@@ -25,7 +25,6 @@
 	void slotLaunchAdmin();
 
 private:
-	QProcess *launchAdminProc;
 
 signals:
 



More information about the Commits mailing list