Magellan Linux

Annotation of /trunk/kdebase-workspace/patches/kdebase-workspace-4.9.4-rootprivs.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1994 - (hide annotations) (download)
Wed Dec 19 09:48:16 2012 UTC (11 years, 5 months ago) by niro
File size: 1955 byte(s)
-added serveral patches
1 niro 1994 diff -ur kdebase-workspace-4.4.90/systemsettings/core/ModuleView.cpp kdebase-workspace-4.4.90-rootprivs/systemsettings/core/ModuleView.cpp
2     --- kdebase-workspace-4.4.90/systemsettings/core/ModuleView.cpp 2010-06-24 18:28:10.000000000 +0200
3     +++ kdebase-workspace-4.4.90-rootprivs/systemsettings/core/ModuleView.cpp 2010-06-26 00:47:30.000000000 +0200
4     @@ -41,6 +41,7 @@
5     #include <KCModuleProxy>
6     #include <KStandardGuiItem>
7     #include <KDialogButtonBox>
8     +#include <KStandardDirs>
9     #include <kauthaction.h>
10    
11     #include "MenuItem.h"
12     @@ -131,6 +132,35 @@
13     return;
14     }
15    
16     + {
17     + MenuItem *menuItemPtr = menuItem.data( Qt::UserRole ).value<MenuItem*>();
18     + if ( menuItemPtr->service()->property( "X-KDE-RootOnly", QVariant::Bool ).toBool() ) {
19     + QString kdesu = KStandardDirs::findExe( "kdesu" );
20     + QString cmd = menuItemPtr->service()->exec().trimmed();
21     +
22     + /* Prepare the process to run the kcmshell */
23     + if ( cmd.left(5) == "kdesu" )
24     + {
25     + cmd = cmd.remove(0,5).trimmed();
26     +
27     + /* Remove all kdesu switches */
28     + while ( cmd.length() > 1 && cmd[ 0 ] == '-' )
29     + cmd = cmd.remove( 0, cmd.indexOf( ' ' ) ).trimmed();
30     + }
31     +
32     + if ( cmd.left(9) == "kcmshell4" )
33     + cmd = cmd.remove(0,9).trimmed();
34     +
35     + QStringList args;
36     + args << "-i" << QString( menuItemPtr->service()->icon() ) << "-c" << QString( "%1 %2 --lang %3" ).arg( KStandardDirs::locate("exe", "kcmshell4") ).arg( cmd ).arg( KGlobal::locale()->language() );
37     +
38     + kDebug() << "Starting root module: " << args;
39     + QProcess::startDetached( kdesu, args );
40     +
41     + return;
42     + }
43     + }
44     +
45     QList<QModelIndex> indexes;
46     for ( int done = 0; menuItem.model()->rowCount( menuItem ) > done; done = 1 + done ) {
47     indexes << menuItem.model()->index( done, 0, menuItem );