diff --git a/projectbuilders/makebuilder/makebuilderconfig.kcfg b/projectbuilders/makebuilder/makebuilderconfig.kcfg
--- a/projectbuilders/makebuilder/makebuilderconfig.kcfg
+++ b/projectbuilders/makebuilder/makebuilderconfig.kcfg
@@ -14,7 +14,7 @@
false
-
+
false
diff --git a/projectbuilders/makebuilder/makeconfig.ui b/projectbuilders/makebuilder/makeconfig.ui
--- a/projectbuilders/makebuilder/makeconfig.ui
+++ b/projectbuilders/makebuilder/makeconfig.ui
@@ -11,12 +11,21 @@
-
- 0
-
QFormLayout::AllNonFixedFieldsGrow
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
-
@@ -95,6 +104,9 @@
false
+
+ true
+
-
kdesu
@@ -152,7 +164,7 @@
-
-
+
0
diff --git a/projectbuilders/makebuilder/makejob.cpp b/projectbuilders/makebuilder/makejob.cpp
--- a/projectbuilders/makebuilder/makejob.cpp
+++ b/projectbuilders/makebuilder/makejob.cpp
@@ -177,19 +177,49 @@
bool runAsRoot = builderGroup.readEntry( "Install As Root", false );
if ( runAsRoot && m_command == InstallCommand )
{
- int suCommand = builderGroup.readEntry( "Su Command", 0 );
- QStringList arguments;
- QString suCommandName;
- switch( suCommand ) {
- case 1:
- return QStringList() << "kdesudo" << "-t";
-
- case 2:
- return QStringList() << "sudo";
-
- default:
- return QStringList() << "kdesu" << "-t";
+ QString suCommand = builderGroup.readEntry( "Su Command", QString() );
+ bool suCommandIsDigit;
+ QStringList suCommandWithArg;
+ int suCommandNum = suCommand.toInt(&suCommandIsDigit);
+ if(suCommandIsDigit)
+ {
+ QString suCommandstr;
+ switch(suCommandNum)
+ {
+ case 1:
+ {
+ suCommand = "kdesudo";
+ break;
+ }
+ case 2:
+ {
+ suCommand = "sudo";
+ break;
+ }
+ default:
+ suCommand = "kdesu";
+
+
+ }
+
+ builderGroup.writeEntry("Su Command", suCommand);
+ //so that suCommandIsDigit becomes false next time
+ //project is opened.
+
+
+ }
+
+
+ QRegExp regEx(" ");
+ suCommandWithArg = suCommand.split(regEx);
+ if( suCommandWithArg.isEmpty() )
+ {
+ suCommandWithArg << "kdesu" << "-t";
}
+
+
+
+ return suCommandWithArg;
}
return QStringList();
}