rpms/kdebase-workspace/F-10 kdebase-workspace-4.1.2-rootprivs.patch, NONE, 1.1 kdebase-workspace.spec, 1.132, 1.133 kdebase-workspace-4.0.72-rootprivs.patch, 1.3, NONE

Than Ngo than at fedoraproject.org
Fri Oct 31 13:54:17 UTC 2008


Author: than

Update of /cvs/extras/rpms/kdebase-workspace/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5465

Modified Files:
	kdebase-workspace.spec 
Added Files:
	kdebase-workspace-4.1.2-rootprivs.patch 
Removed Files:
	kdebase-workspace-4.0.72-rootprivs.patch 
Log Message:
- apply patch to fix multihead issue
- bz#469235, use non-blocking QProcess:startDetacted



kdebase-workspace-4.1.2-rootprivs.patch:

--- NEW FILE kdebase-workspace-4.1.2-rootprivs.patch ---
Index: mainwindow.cpp
===================================================================
--- mainwindow.cpp	(revision 835492)
+++ mainwindow.cpp	(working copy)
@@ -27,6 +27,7 @@
 
 #include <QLayout>
 #include <QStackedWidget>
+#include <QProcess>
 
 #include <KAction>
 #include <KActionCollection>
@@ -42,6 +43,7 @@
 #include <KStandardAction>
 #include <KTabWidget>
 #include <kcategorizedsortfilterproxymodel.h>
+#include <KStandardDirs>
 #include <kcategorizedview.h>
 #include <kcategorydrawer.h>
 #include <kiconloader.h>
@@ -176,13 +178,6 @@
         connect( tv,
                 SIGNAL(activated(const QModelIndex&)),
                 SLOT(selectionChanged(const QModelIndex&)) );
-        if (KGlobalSettings::singleClick()) {
-            connect( tv, SIGNAL(clicked(const QModelIndex&)),
-                     SLOT(selectionChanged(const QModelIndex&)));
-        } else {
-            connect( tv, SIGNAL(doubleClicked(const QModelIndex&)),
-                     SLOT(selectionChanged(const QModelIndex&)));
-        }
         connect( search, SIGNAL(textChanged(const QString&)),
                 kcsfpm, SLOT(setFilterRegExp(const QString&)));
         connect( kcsfpm, SIGNAL(layoutChanged()),
@@ -299,9 +294,13 @@
         return;
 
     MenuItem * mItem = selected.data( Qt::UserRole ).value<MenuItem*>();
+    bool needsRootPrivs = false;
     if ( mItem ) {
         kDebug() << "Selected item: " << mItem->service->name();
         kDebug() << "Comment:       " << mItem->service->comment();
+
+        needsRootPrivs = mItem->service->property( "X-KDE-RootOnly", QVariant::Bool ).toBool();
+        kDebug() << "Needs root privs:" << needsRootPrivs;
     } else {
         kDebug() << ":'( Got dud pointer from " << selected.data( Qt::DisplayRole ).toString();
         Q_ASSERT(mItem); // Would core dump below. Do it now
@@ -313,6 +312,35 @@
     if ( groupWidget )
         return;
 
+    if ( needsRootPrivs )
+    {
+        QString kdesu = KStandardDirs::findExe( "kdesu" );
+        //kDebug() << "kdesu path:" << kdesu;
+
+        QString cmd = mItem->service->exec().trimmed();
+
+        /* Prepare the process to run the kcmshell */
+        if ( cmd.left(5) == "kdesu" )
+        {
+            cmd = cmd.remove(0,5).trimmed();
+
+            /* Remove all kdesu switches */
+            while ( cmd.length() > 1 && cmd[ 0 ] == '-' )
+                cmd = cmd.remove( 0, cmd.indexOf( ' ' ) ).trimmed();
+        }
+
+        if ( cmd.left(9) == "kcmshell4" )
+            cmd = cmd.remove(0,9).trimmed();
+
+        QStringList args;
+        args << "-i" << QString( mItem->service->icon() ) << "-c" << QString( "%1 %2 --lang %3" ).arg( KStandardDirs::locate("exe", "kcmshell4") ).arg( cmd ).arg( KGlobal::locale()->language() );
+
+        kDebug() << "Starting root module: " << args;
+        QProcess::startDetached( kdesu, args );
+
+        return;
+    }
+
     groupWidget = moduleItemToWidgetDict[mItem->service];
 
     if( !groupWidget ) {


Index: kdebase-workspace.spec
===================================================================
RCS file: /cvs/extras/rpms/kdebase-workspace/F-10/kdebase-workspace.spec,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -r1.132 -r1.133
--- kdebase-workspace.spec	31 Oct 2008 13:28:42 -0000	1.132
+++ kdebase-workspace.spec	31 Oct 2008 13:53:47 -0000	1.133
@@ -17,7 +17,7 @@
 Patch4: kdebase-workspace-4.1.1-show-systemsettings.patch
 Patch5: kdebase-workspace-4.0.72-ck-shutdown.patch
 # 434824: KDE4 System Settings - No Method To Enter Administrative Mode
-Patch6: kdebase-workspace-4.0.72-rootprivs.patch
+Patch6: kdebase-workspace-4.1.2-rootprivs.patch
 Patch7: kdebase-workspace-4.0.3-timedate-kcm.patch
 # 441062: packagekit tools do not show icons correctly on KDE
 Patch8: kdebase-workspace-4.0.3-krdb.patch
@@ -354,6 +354,7 @@
 %changelog
 * Fri Oct 31 2008 Than Ngo <than at redhat.com> 4.1.2-8
 - apply patch to fix multihead issue
+- bz#469235, use non-blocking QProcess:startDetacted
 
 * Sat Oct 25 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.1.2-7
 - F10: use KDM default face icon from solar-kde-theme, require it


--- kdebase-workspace-4.0.72-rootprivs.patch DELETED ---




More information about the scm-commits mailing list