GCC Code Coverage Report


Directory: ./
File: lib/configoperation.h
Date: 2023-04-20 22:59:23
Exec Total Coverage
Lines: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*
2 * <one line to give the library's name and an idea of what it does.>
3 * Copyright (C) 2014 Daniel Vratil <dvratil@redhat.com>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20 #ifndef DISMAN_CONFIGOPERATION_H
21 #define DISMAN_CONFIGOPERATION_H
22
23 #include <QObject>
24
25 #include "disman_export.h"
26 #include "types.h"
27
28 namespace Disman
29 {
30
31 class ConfigOperationPrivate;
32
33 class DISMAN_EXPORT ConfigOperation : public QObject
34 {
35 Q_OBJECT
36
37 public:
38 ~ConfigOperation() override;
39
40 bool has_error() const;
41 QString error_string() const;
42
43 virtual Disman::ConfigPtr config() const = 0;
44
45 bool exec();
46
47 Q_SIGNALS:
48 void finished(ConfigOperation* operation);
49
50 protected:
51 explicit ConfigOperation(ConfigOperationPrivate* dd, QObject* parent = nullptr);
52
53 void set_error(const QString& error);
54 void emit_result();
55
56 protected Q_SLOTS:
57 virtual void start() = 0;
58
59 protected:
60 ConfigOperationPrivate* const d_ptr;
61 478 Q_DECLARE_PRIVATE(ConfigOperation)
62 };
63 }
64
65 #endif
66