File indexing completed on 2025-01-05 04:49:32
0001 /* 0002 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "akonadidatabasetoolsutils.h" 0010 #include "akonadidatasetools_private_export.h" 0011 #include <QObject> 0012 class QProcess; 0013 class AKONADIDATASETOOLS_TESTS_EXPORT AkonadiDatabaseToolsJob : public QObject 0014 { 0015 Q_OBJECT 0016 public: 0017 explicit AkonadiDatabaseToolsJob(QObject *parent = nullptr); 0018 ~AkonadiDatabaseToolsJob() override; 0019 0020 [[nodiscard]] bool canStart() const; 0021 0022 void start(); 0023 void setTool(AkonadiDatabaseToolsUtils::AkonadiDatabaseTool newTool); 0024 0025 Q_SIGNALS: 0026 void receivedStandardError(const QString &str); 0027 void receivedStandardOutput(const QString &str); 0028 void finished(); 0029 0030 private: 0031 [[nodiscard]] QString akonadiProcessPath() const; 0032 AkonadiDatabaseToolsUtils::AkonadiDatabaseTool mTool = AkonadiDatabaseToolsUtils::AkonadiDatabaseTool::Unknown; 0033 QProcess *mProcess = nullptr; 0034 };