Changeset View
Changeset View
Standalone View
Standalone View
plugins/execute/nativeappjob.cpp
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Line(s) | |||||
135 | { | 135 | { | ||
136 | // we kill any execution of the configuration | 136 | // we kill any execution of the configuration | ||
137 | auto currentJobs = ICore::self()->runController()->currentJobs(); | 137 | auto currentJobs = ICore::self()->runController()->currentJobs(); | ||
138 | for (auto it = currentJobs.begin(); it != currentJobs.end();) { | 138 | for (auto it = currentJobs.begin(); it != currentJobs.end();) { | ||
139 | NativeAppJob* job = findNativeJob(*it); | 139 | NativeAppJob* job = findNativeJob(*it); | ||
140 | if (job && job != this && job->m_name == m_name) { | 140 | if (job && job != this && job->m_name == m_name) { | ||
141 | QMessageBox::StandardButton button = QMessageBox::question(nullptr, i18n("Job already running"), i18n("'%1' is already being executed. Should we kill the previous instance?", m_name)); | 141 | QMessageBox::StandardButton button = QMessageBox::question(nullptr, i18n("Job already running"), i18n("'%1' is already being executed. Should we kill the previous instance?", m_name)); | ||
142 | if (button != QMessageBox::No && ICore::self()->runController()->currentJobs().contains(*it)) { | 142 | if (button != QMessageBox::No && ICore::self()->runController()->currentJobs().contains(*it)) { | ||
143 | (*it)->kill(); | 143 | (*it)->kill(EmitResult); | ||
144 | } | 144 | } | ||
145 | currentJobs = ICore::self()->runController()->currentJobs(); | 145 | currentJobs = ICore::self()->runController()->currentJobs(); | ||
146 | it = currentJobs.begin(); | 146 | it = currentJobs.begin(); | ||
147 | } else { | 147 | } else { | ||
148 | ++it; | 148 | ++it; | ||
149 | } | 149 | } | ||
150 | } | 150 | } | ||
151 | 151 | | |||
152 | OutputExecuteJob::start(); | 152 | OutputExecuteJob::start(); | ||
153 | } | 153 | } |