Changeset View
Changeset View
Standalone View
Standalone View
plugins/execute/nativeappjob.cpp
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 47 | { | |||
---|---|---|---|---|---|
96 | if( !wc.isValid() || wc.isEmpty() ) { | 96 | if( !wc.isValid() || wc.isEmpty() ) { | ||
97 | wc = QUrl::fromLocalFile( QFileInfo( executable.toLocalFile() ).absolutePath() ); | 97 | wc = QUrl::fromLocalFile( QFileInfo( executable.toLocalFile() ).absolutePath() ); | ||
98 | } | 98 | } | ||
99 | setWorkingDirectory( wc ); | 99 | setWorkingDirectory( wc ); | ||
100 | 100 | | |||
101 | qCDebug(PLUGIN_EXECUTE) << "setting app:" << executable << arguments; | 101 | qCDebug(PLUGIN_EXECUTE) << "setting app:" << executable << arguments; | ||
102 | 102 | | |||
103 | if (iface->useTerminal(cfg)) { | 103 | if (iface->useTerminal(cfg)) { | ||
104 | QStringList args = KShell::splitArgs(iface->terminal(cfg)); | 104 | QString terminalCommand = iface->terminal(cfg); | ||
105 | for (QStringList::iterator it = args.begin(); it != args.end(); ++it) { | 105 | terminalCommand.replace(QLatin1String("%exe"), KShell::quoteArg( executable.toLocalFile()) ); | ||
106 | if (*it == QLatin1String("%exe")) { | 106 | terminalCommand.replace(QLatin1String("%workdir"), KShell::quoteArg( wc.toLocalFile()) ); | ||
107 | *it = KShell::quoteArg(executable.toLocalFile()); | 107 | QStringList args = KShell::splitArgs(terminalCommand); | ||
108 | } else if (*it == QLatin1String("%workdir")) { | | |||
109 | *it = KShell::quoteArg(wc.toLocalFile()); | | |||
110 | } | | |||
111 | } | | |||
112 | args.append( arguments ); | 108 | args.append( arguments ); | ||
113 | *this << args; | 109 | *this << args; | ||
114 | } else { | 110 | } else { | ||
115 | *this << executable.toLocalFile(); | 111 | *this << executable.toLocalFile(); | ||
116 | *this << arguments; | 112 | *this << arguments; | ||
117 | } | 113 | } | ||
118 | 114 | | |||
119 | setJobName(cfg->name()); | 115 | setJobName(cfg->name()); | ||
Show All 27 Lines |