summaryrefslogtreecommitdiffstats
path: root/opensuse/tdebase/fix-kcontrol-yast.diff
blob: 5902d904d48a8c40ca6e87c27072fc5aed262d6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Index: kcontrol/kcontrol/modules.cpp
===================================================================
--- kcontrol/kcontrol/modules.cpp.orig
+++ kcontrol/kcontrol/modules.cpp
@@ -19,6 +19,7 @@
 
 #include <unistd.h>
 #include <sys/types.h>
+#include <stdlib.h>
 
 
 #include <qlabel.h>
@@ -59,6 +60,10 @@ ConfigModule::~ConfigModule()
 
 ProxyWidget *ConfigModule::module()
 {
+  KDesktopFile kd(service()->desktopEntryPath());
+  if ( !kd.readEntry("X-SuSE-YaST-Call").isEmpty() )
+      setenv("KCMYAST2_CALL", kd.readEntry("X-SuSE-YaST-Call").latin1(), 1 );
+
   if (_module)
     return _module;
 
@@ -168,6 +173,7 @@ void ConfigModule::runAsRoot()
   // prepare the process to run the kcmshell
   QString cmd = service()->exec().stripWhiteSpace();
   bool kdeshell = false;
+  bool proxy = false;
   if (cmd.left(5) == "kdesu")
     {
       cmd = cmd.remove(0,5).stripWhiteSpace();
@@ -185,6 +191,15 @@ void ConfigModule::runAsRoot()
       kdeshell = true;
     }
 
+    KDesktopFile kd(service()->desktopEntryPath());
+    if ( !kd.readEntry("X-SuSE-YaST-Call").isEmpty() ){
+      kdeshell = true;
+      proxy = true;
+      cmd=service()->desktopEntryPath();
+
+      setenv("KCMYAST2_CALL", kd.readEntry("X-SuSE-YaST-Call").latin1(), 1 );
+    }
+
   // run the process
   QString kdesu = KStandardDirs::findExe("kdesu");
   if (!kdesu.isEmpty())
@@ -196,12 +211,12 @@ void ConfigModule::runAsRoot()
       // in that case the modules is started through kdesud and kdesu
       // returns before the module is running and that doesn't work.
       // We also don't have a way to close the module in that case.
-      *_rootProcess << "--n"; // Don't keep password.
+      *_rootProcess << "--n" << "-t"; // Don't keep password.
       if (kdeshell) {
-         *_rootProcess << QString("%1 %2 --embed %3 --lang %4").arg(locate("exe", "kcmshell")).arg(cmd).arg(_embedWidget->winId()).arg(KGlobal::locale()->language());
+         *_rootProcess << QString("%1 %2 %3 %4 --lang %5").arg(locate("exe", "kcmshell")).arg(cmd).arg(proxy?"--embed-proxy":"--embed").arg(_embedWidget->winId()).arg(KGlobal::locale()->language());
       }
       else {
-         *_rootProcess << QString("%1 --embed %2 --lang %3").arg(cmd).arg(_embedWidget->winId()).arg( KGlobal::locale()->language() );
+         *_rootProcess << QString("%1 %2 %3 --lang %4").arg(cmd).arg(proxy?"--embed-proxy":"--embed").arg(_embedWidget->winId()).arg( KGlobal::locale()->language() );
       }
 
       connect(_rootProcess, SIGNAL(processExited(KProcess*)), this, SLOT(rootExited(KProcess*)));