[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE_3_1_BRANCH: kdebase/kdesktop
From:       David Faure <faure () kde ! org>
Date:       2003-01-29 20:29:30
[Download RAW message or body]

CVS commit by faure: 

Backporting -r1.139:
Patch from BR 52176, can't get rid of "Run in terminal". 
 Thanks to Andreas Leuner <almighty at atlantis.wh2.tu-dresden.de> 
CCMAIL: 52176@bugs.kde.org


  M +24 -11    minicli.cpp   1.136.2.2


--- kdebase/kdesktop/minicli.cpp  #1.136.2.1:1.136.2.2
@@ -244,5 +244,4 @@ int Minicli::runCommand()
     }
 
-    bool useTerminal = mpAdvanced && mpAdvanced->terminal();
     QString cmdNoArgs = cmd.stripWhiteSpace();
     {
@@ -251,14 +250,18 @@ int Minicli::runCommand()
           cmdNoArgs.truncate(i);
     }
+    
+    bool useTerminal;
     if (!mpAdvanced || mpAdvanced->isHidden()) // Advanced options have not been touched
-    {
-       if (terminalAppList.contains(cmdNoArgs))
-          useTerminal = true;
-    }
-    else if (!mpAdvanced->needsKDEsu())
+       // take the stored setting
+       useTerminal = terminalAppList.contains(cmdNoArgs);
+    else 
     {
        terminalAppList.remove(cmdNoArgs);
-       if (useTerminal)
+       
+       if (useTerminal = mpAdvanced->terminal())
           terminalAppList.append(cmdNoArgs);
+          
+       /*Now the terminalAppList will contain cmdNoArgs iff the checkbox is marked 
+         (provided it is seen by the user)*/
     }
 
@@ -453,4 +456,17 @@ void Minicli::slotCmdChanged(const QStri
         return;
     }
+    else
+    {
+      QString cmdNoArgs = text.stripWhiteSpace();
+      {
+        int i = cmdNoArgs.find(' ');
+        if (i != -1)
+            cmdNoArgs.truncate(i);
+      }
+    
+      // Look if the new app is a TerminalApp
+      if (mpAdvanced)
+        mpAdvanced->slotTerminal(terminalAppList.contains(cmdNoArgs));
+    }
 
     m_parseTimer->start(250, true);
@@ -478,6 +494,5 @@ void Minicli::slotAdvanced()
            if (i != -1)
                cmdNoArgs.truncate(i);
-           if (terminalAppList.contains(cmdNoArgs))
-              mpAdvanced->slotTerminal(true);
+           mpAdvanced->slotTerminal(terminalAppList.contains(cmdNoArgs));
         }
 
@@ -530,6 +545,4 @@ void Minicli::parseLine( bool final )
            if (i != -1)
                cmdNoArgs.truncate(i);
-           if (terminalAppList.contains(cmdNoArgs))
-              mpAdvanced->slotTerminal(true);
          }
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic