1 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
5 #include <KCModuleProxy>
6 #include <KStandardGuiItem>
7 #include <KDialogButtonBox>
8 +#include <KStandardDirs>
9 #include <kauthaction.h>
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();
22 + /* Prepare the process to run the kcmshell */
23 + if ( cmd.left(5) == "kdesu" )
25 + cmd = cmd.remove(0,5).trimmed();
27 + /* Remove all kdesu switches */
28 + while ( cmd.length() > 1 && cmd[ 0 ] == '-' )
29 + cmd = cmd.remove( 0, cmd.indexOf( ' ' ) ).trimmed();
32 + if ( cmd.left(9) == "kcmshell4" )
33 + cmd = cmd.remove(0,9).trimmed();
36 + args << "-i" << QString( menuItemPtr->service()->icon() ) << "-c" << QString( "%1 %2 --lang %3" ).arg( KStandardDirs::locate("exe", "kcmshell4") ).arg( cmd ).arg( KGlobal::locale()->language() );
38 + kDebug() << "Starting root module: " << args;
39 + QProcess::startDetached( kdesu, args );
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 );