digiKam
commandtask.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2015-06-07
7  * Description : a tool to create panorama by fusion of several images.
8  *
9  * Copyright (C) 2015-2016 by Benjamin Girault <benjamin dot girault at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * ============================================================ */
22 
23 #ifndef DIGIKAM_COMMAND_TASK_H
24 #define DIGIKAM_COMMAND_TASK_H
25 
26 // Qt includes
27 
28 #include <QProcess>
29 
30 // Local includes
31 
32 #include "panotask.h"
33 
35 {
36 
37 class CommandTask : public PanoTask
38 {
39 public:
40 
41  explicit CommandTask(PanoAction action, const QString& workDirPath, const QString& commandPath);
42  ~CommandTask() override = default;
43 
44  void requestAbort() override;
45 
46 protected:
47 
48  QString output;
49 
50 protected:
51 
52  void runProcess(QStringList& args);
53  QString getProgram();
54  QString getCommandLine();
55  QString getProcessError();
56  void printDebug(const QString& binaryName);
57 
58 private:
59 
60  QSharedPointer<QProcess> process;
61  QString commandPath;
62 
63 private:
64 
65  // Disable
66  CommandTask() = delete;
67 
68  Q_DISABLE_COPY(CommandTask)
69 };
70 
71 } // namespace DigikamGenericPanoramaPlugin
72 
73 #endif // DIGIKAM_COMMAND_TASK_H
Definition: commandtask.h:38
QString getProgram()
Definition: commandtask.cpp:87
QString output
Definition: commandtask.h:48
QString getProcessError()
Definition: commandtask.cpp:107
QString getCommandLine()
Definition: commandtask.cpp:97
void requestAbort() override
Definition: commandtask.cpp:48
void printDebug(const QString &binaryName)
Definition: commandtask.cpp:126
void runProcess(QStringList &args)
Definition: commandtask.cpp:58
const PanoAction action
Definition: panotask.h:52
Definition: panoactions.h:36
PanoAction
Definition: panoactions.h:39