Summary: | after ALT+F2: can't get rid of "Run in terminal" | ||
---|---|---|---|
Product: | kdesktop | Reporter: | Andreas Leuner <almighty> |
Component: | general | Assignee: | David Faure <faure> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | finex |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
for kdebase/kdesktop/minicli.cpp
fixes terminal app checkbox |
Description
Andreas Leuner
2002-12-22 00:00:22 UTC
funny bug Created attachment 641 [details]
for kdebase/kdesktop/minicli.cpp
Really :-)
I fixed this for me. The attached patch implements the "ability" to run
applications that were run in a terminal to run without a terminal.
It also eliminates another sort of strange behavior. Steps to reproduce:
1. Press ALT+F2 to open the "Run command" dialog
2. Enter e.g. "ls" (or another app already known as a terminal app)
3. Open the advanced options
4. Type in another command or scroll through the command history
The "Run in terminal" checkbox will remain checked during step 4.
OK, as I already said, the patch fixes it for me. It even contains some
explaining comments.
Hope it helps,
Andreas Leuner
Subject: kdebase/kdesktop CVS commit by faure: Applied 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-done@bugs.kde.org M +24 -11 minicli.cpp 1.139 --- kdebase/kdesktop/minicli.cpp #1.138:1.139 @@ -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); } } this bug remains for me in 3.1, using the Suse 8.0 RPMs As I learn from looking into the webcvs the patch has only been applied to CVS HEAD almost directly after the KDE_3_1_BRANCH had been created. Everything changed between the current KDE_3_1_BRANCH version and "my" change is trivial. My patch will apply cleanly to the current KDE_3_1_BRANCH. Although I haven't tested if it would compile or even work I strongly suppose so. Could someone check it in, please? Subject: KDE_3_1_BRANCH: kdebase/kdesktop 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); } } The behavior I described in comment #2 occurs again in current HEAD. Created attachment 2224 [details]
fixes terminal app checkbox
*** Bug has been marked as fixed ***. Bug closed. Kdesktop is no more mantained. |