source: calamares/trunk/fuentes/src/libcalamares/ProcessJob.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 17 months ago

sync with github

File size: 1.8 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014, Teo Mrnjavac <teo@kde.org>
4 *   Copyright 2017, Adriaan de Groot <groot@kde.org>
5 *
6 *   Calamares is free software: you can redistribute it and/or modify
7 *   it under the terms of the GNU General Public License as published by
8 *   the Free Software Foundation, either version 3 of the License, or
9 *   (at your option) any later version.
10 *
11 *   Calamares is distributed in the hope that it will be useful,
12 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 *   GNU General Public License for more details.
15 *
16 *   You should have received a copy of the GNU General Public License
17 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef CALAMARES_PROCESSJOB_H
21#define CALAMARES_PROCESSJOB_H
22
23#include "Job.h"
24
25namespace Calamares {
26
27class ProcessJob : public Job
28{
29    Q_OBJECT
30public:
31    explicit ProcessJob( const QString& command,
32                         const QString& workingPath,
33                         bool runInChroot = false,
34                         int secondsTimeout = 30,
35                         QObject* parent = nullptr );
36    virtual ~ProcessJob() override;
37
38    QString prettyName() const override;
39    QString prettyStatusMessage() const override;
40    JobResult exec() override;
41
42private:
43    int callOutput( const QString& command,
44                    QString& output,
45                    const QString& workingPath = QString(),
46                    const QString& stdInput = QString(),
47                    int timeoutSec = 0 );
48    QString m_command;
49    QString m_workingPath;
50    bool m_runInChroot;
51    int m_timeoutSec;
52};
53
54} // namespace Calamares
55
56#endif // CALAMARES_PROCESSJOB_H
Note: See TracBrowser for help on using the repository browser.