File indexing completed on 2024-04-14 15:32:44

0001 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0002 // SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org>
0003 
0004 #pragma once
0005 
0006 #include <QObject>
0007 
0008 #include "systeminformation.h"
0009 
0010 /**
0011  * @brief QML exposure class for DrKonqi.
0012  * Since DrKonqi is not meant for construction but also not a proper singleton it sports
0013  * static functions that we'll want to pull into a context object that actually can serve
0014  * as singleton. This is meant to be a temporary crutch, ideally DrKonqi gets
0015  * refactored to a proper singleton.
0016  */
0017 class Doctore : public QObject
0018 {
0019     Q_OBJECT
0020     // TODO redo DrKonqi so it can work with QML and convert everything to properties.
0021 public:
0022     using QObject::QObject;
0023 
0024     static Q_INVOKABLE void saveReport(const QString &text);
0025     static Q_INVOKABLE void copyToClipboard(const QString &text);
0026     static Q_INVOKABLE QString appName();
0027     static Q_INVOKABLE QString kdeBugzillaURL();
0028     static Q_INVOKABLE bool isSafer();
0029     static Q_INVOKABLE bool ignoreQuality();
0030 
0031 private:
0032     Q_PROPERTY(SystemInformation *systemInformation READ systemInformation CONSTANT)
0033     static SystemInformation *systemInformation();
0034 };