packages: kde4-kdebase-workspace/kde4-kdebase-workspace-rootprivs.patch - u...

shadzik shadzik at pld-linux.org
Thu Oct 29 02:29:52 CET 2009


Author: shadzik                      Date: Thu Oct 29 01:29:52 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- updated

---- Files affected:
packages/kde4-kdebase-workspace:
   kde4-kdebase-workspace-rootprivs.patch (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: packages/kde4-kdebase-workspace/kde4-kdebase-workspace-rootprivs.patch
diff -u packages/kde4-kdebase-workspace/kde4-kdebase-workspace-rootprivs.patch:1.3 packages/kde4-kdebase-workspace/kde4-kdebase-workspace-rootprivs.patch:1.4
--- packages/kde4-kdebase-workspace/kde4-kdebase-workspace-rootprivs.patch:1.3	Sat Feb 21 00:08:10 2009
+++ packages/kde4-kdebase-workspace/kde4-kdebase-workspace-rootprivs.patch	Thu Oct 29 02:29:47 2009
@@ -1,61 +1,21 @@
-Index: mainwindow.cpp
-===================================================================
---- kde4-kdebase-workspace/systemsettings/mainwindow.cpp	(revision 835492)
-+++ kde4-kdebase-workspace/systemsettings/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>
+diff -ur kdebase-workspace-4.2.95/systemsettings/core/ModuleView.cpp kdebase-workspace-4.2.95-rootprivs/systemsettings/core/ModuleView.cpp
+--- kdebase-workspace-4.2.95/systemsettings/core/ModuleView.cpp	2009-06-23 13:14:38.000000000 +0200
++++ kdebase-workspace-4.2.95-rootprivs/systemsettings/core/ModuleView.cpp	2009-06-29 19:39:01.000000000 +0200
+@@ -39,6 +39,7 @@
+ #include <KCModuleProxy>
+ #include <KStandardGuiItem>
+ #include <KDialogButtonBox>
 +#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;
+ #include "MenuItem.h"
+ 
+@@ -124,6 +125,32 @@
+       return;
+     }
  
-+    if ( needsRootPrivs )
-+    {
++    if ( menuItem->service()->property( "X-KDE-RootOnly", QVariant::Bool ).toBool() ) {
 +        QString kdesu = KStandardDirs::findExe( "kdesu" );
-+        //kDebug() << "kdesu path:" << kdesu;
-+
-+        QString cmd = mItem->service->exec().trimmed();
++        QString cmd = menuItem->service()->exec().trimmed();
 +
 +        /* Prepare the process to run the kcmshell */
 +        if ( cmd.left(5) == "kdesu" )
@@ -71,7 +31,7 @@
 +            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() );
++        args << "-i" << QString( menuItem->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 );
@@ -79,6 +39,6 @@
 +        return;
 +    }
 +
-     groupWidget = moduleItemToWidgetDict[mItem->service];
- 
-     if( !groupWidget ) {
+     QList<KCModuleInfo*> modules;
+     if ( menuItem->children().empty() ) {
+         modules << &menuItem->item();
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kde4-kdebase-workspace/kde4-kdebase-workspace-rootprivs.patch?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list