File indexing completed on 2024-04-14 05:38:14
0001 /* 0002 SPDX-FileCopyrightText: 2020 Harald Sitter <sitter@kde.org> 0003 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 */ 0005 0006 #pragma once 0007 0008 #include <QObject> 0009 0010 /** 0011 * Runs the upgrader. Possibly displays UI if the upgrader craps out unexpectedly during 0012 * startup. 0013 */ 0014 class UpgraderProcess : public QObject 0015 { 0016 Q_OBJECT 0017 public: 0018 using QObject::QObject; 0019 0020 void setUseDevel(bool useDevel); 0021 void run(); 0022 0023 signals: 0024 // Either the process finished or it registered on dbus. 0025 // Notifier should consider this launch concluded. 0026 void notPending(); 0027 0028 private slots: 0029 void onUnexpectedFinish(int code); 0030 0031 private: 0032 bool m_useDevel = false; 0033 bool m_waiting = true; // only true while we wait for the proc to fail 0034 QString m_output; 0035 };