add more spacing
[personal-kdebase.git] / workspace / plasma / dataengines / applicationjobs / jobaction.cpp
blob47be9a956d9bd8e609e3967ccb48bfc0c2a9914e
1 /*
2 * Copyright © 2008 Rob Scheepmaker <r.scheepmaker@student.utwente.nl>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License version 2 as
6 * published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details
13 * You should have received a copy of the GNU Library General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #include "jobaction.h"
20 #include "kuiserverengine.h"
22 #include <kdebug.h>
24 void JobAction::start()
26 kDebug() << "Trying to perform the action" << operationName();
28 if (!m_jobView) {
29 setErrorText(i18nc("%1 is the subject (can be anything) upon which the job is performed",
30 "The JobView for %1 can't be found", destination()));
31 setError(-1);
32 emitResult();
33 return;
36 //TODO: check with capabilities before performing actions.
37 if (operationName() == "resume") {
38 emit m_jobView->resumeRequested();
39 } else if (operationName() == "suspend") {
40 emit m_jobView->suspendRequested();
41 } else if (operationName() == "stop") {
42 emit m_jobView->cancelRequested();
45 emitResult();
48 #include "jobaction.moc"