Changeset View
Changeset View
Standalone View
Standalone View
plugins/execute/nativeappjob.cpp
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Line(s) | |||||
132 | 132 | | |||
133 | void NativeAppJob::start() | 133 | void NativeAppJob::start() | ||
134 | { | 134 | { | ||
135 | // we kill any execution of the configuration | 135 | // we kill any execution of the configuration | ||
136 | foreach(KJob* j, ICore::self()->runController()->currentJobs()) { | 136 | foreach(KJob* j, ICore::self()->runController()->currentJobs()) { | ||
137 | NativeAppJob* job = findNativeJob(j); | 137 | NativeAppJob* job = findNativeJob(j); | ||
138 | if (job && job != this && job->m_cfgname == m_cfgname) { | 138 | if (job && job != this && job->m_cfgname == m_cfgname) { | ||
139 | QMessageBox::StandardButton button = QMessageBox::question(nullptr, i18n("Job already running"), i18n("'%1' is already being executed. Should we kill the previous instance?", m_cfgname)); | 139 | QMessageBox::StandardButton button = QMessageBox::question(nullptr, i18n("Job already running"), i18n("'%1' is already being executed. Should we kill the previous instance?", m_cfgname)); | ||
140 | if (button != QMessageBox::No) | 140 | if (button != QMessageBox::No && ICore::self()->runController()->currentJobs().contains(j)) | ||
141 | j->kill(); | 141 | j->kill(); | ||
142 | } | 142 | } | ||
143 | } | 143 | } | ||
144 | 144 | | |||
145 | OutputExecuteJob::start(); | 145 | OutputExecuteJob::start(); | ||
146 | } | 146 | } |