[plasma/drkonqi] src: Port to qml module
Tobias Fella <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 853731ea0101e1b9ff8da4be3b89ea7260e77463 by Tobias Fella.
Committed on 22/07/2026 at 12:25.
Pushed by tfella into branch 'master'.
Port to qml module
M +79 -29 src/CMakeLists.txt
M +11 -0 src/backtracegenerator.h
M +3 -0 src/bugzillaintegration/bugzillalib.h
M +9 -0 src/bugzillaintegration/reportinterface.h
M +5 -0 src/coredump/gui/CMakeLists.txt
M +10 -0 src/crashedapplication.h
M +3 -0 src/debugpackageinstaller.h
M +3 -29 src/drkonqidialog.cpp
D +0 -22 src/parser/CMakeLists.txt
M +4 -0 src/parser/backtraceparser.h
M +1 -1 src/qml/BacktracePage.qml
M +1 -1 src/qml/BugzillaPage.qml
M +1 -1 src/qml/ContextPage.qml
M +2 -2 src/qml/DeveloperPage.qml
M +1 -1 src/qml/LoginPage.qml
R +1 -1 src/qml/Main.qml [from: src/qml/main.qml - 098% similarity]
M +2 -2 src/qml/MainPage.qml
M +1 -1 src/qml/PreviewPage.qml
M +1 -1 src/qml/ReportPage.qml
M +1 -1 src/qml/SendingPage.qml
M +1 -1 src/qml/WelcomePage.qml
D +0 -27 src/qml/qml.qrc
D +0 -3 src/qml/qmldir
M +3 -0 src/qmlextensions/credentialstore.h
M +4 -1 src/qmlextensions/doctore.h
M +4 -2 src/qmlextensions/platformmodel.h
M +3 -0 src/qmlextensions/reproducibilitymodel.h
M +1 -0 src/settings.kcfgc
M +1 -1 src/systemd/CMakeLists.txt
M +3 -3 src/tests/CMakeLists.txt
M +2 -2 src/tests/backtraceparsertest/CMakeLists.txt
M +1 -1 src/tests/bugzillalibtest/CMakeLists.txt
https://invent.kde.org/plasma/drkonqi/-/commit/853731ea0101e1b9ff8da4be3b89ea7260e77463
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a258bca9d..7c5c611af 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,7 +14,6 @@ configure_file(config-drkonqi.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-drkonqi
add_subdirectory(core)
add_subdirectory(bugzillaintegration/libbugzilla)
add_subdirectory(data)
-add_subdirectory(parser)
set(drkonqi_SRCS
drkonqidialog.cpp
@@ -51,6 +50,16 @@ set(drkonqi_SRCS
statusnotifier_activationclosetimer.h
linuxprocmapsparser.h
drkonqi_globals.h
+ parser/backtraceline.h
+ parser/backtraceparser.cpp
+ parser/backtraceparsergdb.cpp
+ parser/backtraceparsergdb.h
+ parser/backtraceparser.h
+ parser/backtraceparserlldb.cpp
+ parser/backtraceparserlldb.h
+ parser/backtraceparsernull.cpp
+ parser/backtraceparsernull.h
+ parser/backtraceparser_p.h
qmlextensions/platformmodel.h
qmlextensions/reproducibilitymodel.h
qmlextensions/credentialstore.h
@@ -69,6 +78,15 @@ set(drkonqi_SRCS
bugzillaintegration/productmapping.h
)
+ecm_qt_declare_logging_category(
+ drkonqi_SRCS
+ HEADER drkonqi_parser_debug.h
+ IDENTIFIER DRKONQI_PARSER_LOG
+ CATEGORY_NAME org.kde.drkonqi.parser
+ DESCRIPTION "drkonqi parser"
+ EXPORT DRKONQI
+)
+
ecm_qt_declare_logging_category(
drkonqi_SRCS
HEADER drkonqi_debug.h
@@ -82,43 +100,75 @@ ecm_qt_declare_logging_category(
add_library(DrKonqiInternal STATIC ${drkonqi_SRCS})
kconfig_add_kcfg_files(DrKonqiInternal GENERATE_MOC settings.kcfgc)
-target_link_libraries(
- DrKonqiInternal
- DrKonqiSentryInternal
- KF6::GuiAddons
- KF6::I18n
- KF6::CoreAddons
- KF6::ConfigGui
- KF6::JobWidgets
- KF6::KIOCore
- KF6::KIOGui
- KF6::Crash
- KF6::WindowSystem
- Qt::DBus
- Qt::Concurrent
- Qt::Qml
- KF6::WidgetsAddons
- KF6::Wallet
- KF6::Notifications # for status notifier
- KF6::IdleTime # hide status notifier only if user saw it
- KF6::SyntaxHighlighting # Backtrace Highlighting
- KF6::StatusNotifierItem
- drkonqi_backtrace_parser
- drkonqi-core
- qbugzilla
+target_include_directories(DrKonqiInternal PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/qmlextensions ${CMAKE_CURRENT_SOURCE_DIR}/parser)
+
+set_source_files_properties(
+ qml/Globals.qml
+ PROPERTIES
+ QT_QML_SINGLETON_TYPE TRUE
+)
+
+ecm_add_qml_module(DrKonqiInternal URI org.kde.drkonqi GENERATE_PLUGIN_SOURCE
+ QML_FILES
+ qml/Main.qml
+ qml/MainPage.qml
+ qml/DeveloperPage.qml
+ qml/BugzillaPage.qml
+ qml/RatingItem.qml
+ qml/ReportPage.qml
+ qml/WelcomePage.qml
+ qml/ContextPage.qml
+ qml/LoginPage.qml
+ qml/PreviewPage.qml
+ qml/BacktracePage.qml
+ qml/Globals.qml
+ qml/FooterActionBar.qml
+ qml/SendingPage.qml
+ qml/SentPage.qml
+ qml/SentryPage.qml
+ qml/MainPageButton.qml
+ qml/DownloadSymbolsCheckBox.qml
+)
+
+target_link_libraries(DrKonqiInternal
+ PRIVATE
+ KF6::GuiAddons
+ KF6::I18n
+ KF6::CoreAddons
+ KF6::ConfigGui
+ KF6::JobWidgets
+ KF6::KIOCore
+ KF6::KIOGui
+ KF6::Crash
+ KF6::WindowSystem
+ Qt::DBus
+ Qt::Concurrent
+ KF6::WidgetsAddons
+ KF6::Wallet
+ KF6::Notifications # for status notifier
+ KF6::IdleTime # hide status notifier only if user saw it
+ KF6::SyntaxHighlighting # Backtrace Highlighting
+ KF6::StatusNotifierItem
+ drkonqi-core
+ qbugzilla
+ PUBLIC
+ DrKonqiSentryInternal
+ Qt::Qml
)
add_subdirectory(systemd)
add_subdirectory(coredump)
target_sources(DrKonqiInternal PRIVATE coredumpbackend.cpp coredumpbackend.h)
-target_link_libraries(DrKonqiInternal drkonqi-coredump) # needed for logs extraction
-target_link_libraries(DrKonqiInternal drkonqi-coredumpexcavator)
+target_link_libraries(DrKonqiInternal PRIVATE drkonqi-coredump) # needed for logs extraction
+target_link_libraries(DrKonqiInternal PRIVATE drkonqi-coredumpexcavator)
target_compile_definitions(DrKonqiInternal PRIVATE SYSTEMD_AVAILABLE)
-add_executable(drkonqi main.cpp qml/qml.qrc)
+add_executable(drkonqi main.cpp)
ecm_mark_nongui_executable(drkonqi)
-target_link_libraries(drkonqi DrKonqiInternal)
+target_link_libraries(drkonqi PRIVATE DrKonqiInternal Qt::Widgets Qt::DBus KF6::CoreAddons KF6::ConfigCore KF6::I18n)
+
+target_link_libraries(drkonqi PRIVATE DrKonqiInternalplugin)
install(TARGETS drkonqi DESTINATION ${KDE_INSTALL_LIBEXECDIR})
configure_file(org.kde.drkonqi.desktop.cmake ${CMAKE_BINARY_DIR}/src/org.kde.drkonqi.desktop)
diff --git a/src/backtracegenerator.h b/src/backtracegenerator.h
index 8ba5c50f6..03ed888af 100644
--- a/src/backtracegenerator.h
+++ b/src/backtracegenerator.h
@@ -14,10 +14,13 @@
#include <QFutureWatcher>
#include <QProcess>
+#include <QQmlEngine>
#include <QTemporaryFile>
#include <QUrl>
#include "debugger.h"
+#include "debuggermanager.h"
+#include "drkonqi.h"
#include "systemd/memoryfence.h"
class KProcess;
@@ -28,6 +31,8 @@ class QLockFile;
class BacktraceGenerator : public QObject
{
Q_OBJECT
+ QML_ELEMENT
+ QML_SINGLETON
Q_PROPERTY(State state READ state NOTIFY stateChanged)
Q_PROPERTY(bool hasAnyFailure READ hasAnyFailure NOTIFY stateChanged) // derives from state
@@ -47,6 +52,12 @@ public:
};
Q_ENUM(State)
+ static BacktraceGenerator *create(QQmlEngine *, QJSEngine *)
+ {
+ QQmlEngine::setObjectOwnership(DrKonqi::debuggerManager()->backtraceGenerator(), QQmlEngine::CppOwnership);
+ return DrKonqi::debuggerManager()->backtraceGenerator();
+ }
+
BacktraceGenerator(const Debugger &debugger, QObject *parent);
~BacktraceGenerator() override;
diff --git a/src/bugzillaintegration/bugzillalib.h b/src/bugzillaintegration/bugzillalib.h
index 1d13cb81c..13075db08 100644
--- a/src/bugzillaintegration/bugzillalib.h
+++ b/src/bugzillaintegration/bugzillalib.h
@@ -13,6 +13,7 @@
#include <QObject>
#include <QString>
+#include <qqmlintegration.h>
#include "libbugzilla/clients/commands/newbug.h"
#include "libbugzilla/models/product.h"
@@ -25,6 +26,8 @@ class KJob;
class BugzillaManager : public QObject
{
Q_OBJECT
+ QML_ELEMENT
+ QML_UNCREATABLE("Get using PlatformModel.manager")
public:
// Note: it expect the bugTrackerUrl parameter to contain the trailing slash.
diff --git a/src/bugzillaintegration/reportinterface.h b/src/bugzillaintegration/reportinterface.h
index d7914f0ac..ff8f75fee 100644
--- a/src/bugzillaintegration/reportinterface.h
+++ b/src/bugzillaintegration/reportinterface.h
@@ -12,6 +12,7 @@
#define REPORTINTERFACE__H
#include <QObject>
+#include <QQmlEngine>
#include <QStringList>
#include <QTimer>
@@ -28,6 +29,9 @@ class ProductMapping;
class ReportInterface : public QObject
{
Q_OBJECT
+ QML_ELEMENT
+ QML_SINGLETON
+
Q_PROPERTY(BugzillaManager *bugzilla READ bugzillaManager CONSTANT)
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
Q_PROPERTY(QString detailText MEMBER m_reportDetailText WRITE setDetailText NOTIFY detailTextChanged)
@@ -68,6 +72,11 @@ public:
Q_ENUM(DrKonqiStamp)
static ReportInterface *self();
+ static ReportInterface *create(QQmlEngine *, QJSEngine *)
+ {
+ QQmlEngine::setObjectOwnership(self(), QQmlEngine::CppOwnership);
+ return self();
+ }
Q_SIGNAL void awarenessChanged();
diff --git a/src/coredump/gui/CMakeLists.txt b/src/coredump/gui/CMakeLists.txt
index 4ec80f05e..8b83d44b7 100644
--- a/src/coredump/gui/CMakeLists.txt
+++ b/src/coredump/gui/CMakeLists.txt
@@ -9,7 +9,12 @@ target_compile_definitions(drkonqi-coredump-gui
target_link_libraries(drkonqi-coredump-gui PRIVATE
DrKonqiInternal
Qt::Quick
+ Qt::Widgets
KF6::I18n
+ KF6::ConfigCore
+ KF6::CoreAddons
+ KF6::Service
+ KF6::KIOGui
drkonqi-core
drkonqi-coredump
drkonqi-coredumpexcavator
diff --git a/src/crashedapplication.h b/src/crashedapplication.h
index 9100a7454..ba172d57a 100644
--- a/src/crashedapplication.h
+++ b/src/crashedapplication.h
@@ -10,6 +10,7 @@
#include <QDateTime>
#include <QFileInfo>
#include <QObject>
+#include <QQmlEngine>
#include "bugreportaddress.h"
@@ -20,6 +21,9 @@ using EntriesHash = QHash<QByteArray, QByteArray>;
class CrashedApplication : public QObject
{
Q_OBJECT
+ QML_ELEMENT
+ QML_SINGLETON
+
Q_PROPERTY(QString name READ name CONSTANT)
Q_PROPERTY(QFileInfo executable READ executable CONSTANT)
Q_PROPERTY(QString exectuableAbsoluteFilePath READ exectuableAbsoluteFilePath CONSTANT)
@@ -35,6 +39,12 @@ class CrashedApplication : public QObject
Q_PROPERTY(bool hasDeletedFiles READ hasDeletedFiles CONSTANT)
Q_PROPERTY(bool wasNotResponding READ wasNotResponding CONSTANT)
public:
+ static CrashedApplication *create(QQmlEngine *, QJSEngine *)
+ {
+ QQmlEngine::setObjectOwnership(DrKonqi::crashedApplication(), QQmlEngine::CppOwnership);
+ return DrKonqi::crashedApplication();
+ }
+
CrashedApplication(int pid,
int thread,
int signalNumber,
diff --git a/src/debugpackageinstaller.h b/src/debugpackageinstaller.h
index 00e267e73..6bf43225e 100644
--- a/src/debugpackageinstaller.h
+++ b/src/debugpackageinstaller.h
@@ -10,6 +10,7 @@
#include <QObject>
#include <QProcess>
+#include <qqmlintegration.h>
class KProcess;
class QProgressDialog;
@@ -17,6 +18,8 @@ class QProgressDialog;
class DebugPackageInstaller : public QObject
{
Q_OBJECT
+ QML_ELEMENT
+
Q_PROPERTY(bool canInstallDebugPackages READ canInstallDebugPackages CONSTANT)
public:
diff --git a/src/drkonqidialog.cpp b/src/drkonqidialog.cpp
index b9776be50..bc9280f52 100644
--- a/src/drkonqidialog.cpp
+++ b/src/drkonqidialog.cpp
@@ -11,13 +11,13 @@
#include <QQmlContext>
#include "backtracegenerator.h"
-#include "backtraceparser.h"
#include "bugzillaintegration/bugzillalib.h"
#include "config-drkonqi.h"
#include "crashedapplication.h"
#include "debuggermanager.h"
#include "debugpackageinstaller.h"
#include "drkonqi.h"
+#include "parser/backtraceparser.h"
#include "qmlextensions/credentialstore.h"
#include "qmlextensions/doctore.h"
#include "qmlextensions/platformmodel.h"
@@ -32,37 +32,11 @@ void DrKonqiDialog::show(DrKonqiDialog::GoTo to)
l10nContext->setTranslationDomain(QStringLiteral(TRANSLATION_DOMAIN));
engine->rootContext()->setContextObject(l10nContext);
- qmlRegisterType<BugzillaManager>("org.kde.drkonqi", 1, 0, "Bugzilla");
- qmlRegisterType<PlatformModel>("org.kde.drkonqi", 1, 0, "PlatformModel");
- qmlRegisterType<ReproducibilityModel>("org.kde.drkonqi", 1, 0, "ReproducibilityModel");
- qmlRegisterType<CredentialStore>("org.kde.drkonqi", 1, 0, "CredentialStore");
- qmlRegisterType<DebugPackageInstaller>("org.kde.drkonqi", 1, 0, "DebugPackageInstaller");
-
- qmlRegisterSingletonInstance("org.kde.drkonqi", 1, 0, "ReportInterface", ReportInterface::self());
- qmlRegisterSingletonInstance("org.kde.drkonqi", 1, 0, "CrashedApplication", DrKonqi::crashedApplication());
- qmlRegisterSingletonInstance("org.kde.drkonqi", 1, 0, "BacktraceGenerator", DrKonqi::debuggerManager()->backtraceGenerator());
-
- static Doctore doctore;
- qmlRegisterSingletonInstance("org.kde.drkonqi", 1, 0, "DrKonqi", &doctore);
-
- auto settings = Settings::self();
- qmlRegisterSingletonInstance("org.kde.drkonqi", 1, 0, "Settings", settings);
-
- // TODO do we need this second BG?
- qmlRegisterUncreatableType<BacktraceGenerator>("org.kde.drkonqi", 1, 0, "BacktraceGenerator1", QStringLiteral("Cannot create WarningLevel in QML"));
- qmlRegisterUncreatableType<BacktraceParser>("org.kde.drkonqi", 1, 0, "BacktraceParser", QStringLiteral("Cannot create WarningLevel in QML"));
-
- const QUrl mainUrl(QStringLiteral("qrc:/ui/main.qml"));
QObject::connect(
engine,
&QQmlApplicationEngine::objectCreated,
this,
- [mainUrl, this, to](QObject *obj, const QUrl &objUrl) {
- if (!obj && mainUrl == objUrl) {
- qWarning() << "Failed to load QML dialog";
- return;
- }
-
+ [to](QObject *obj, const QUrl &) {
switch (to) {
case GoTo::Main:
break;
@@ -72,7 +46,7 @@ void DrKonqiDialog::show(DrKonqiDialog::GoTo to)
}
},
Qt::QueuedConnection);
- engine->load(mainUrl);
+ engine->loadFromModule("org.kde.drkonqi", "Main");
}
#include "moc_drkonqidialog.cpp"
diff --git a/src/parser/CMakeLists.txt b/src/parser/CMakeLists.txt
deleted file mode 100644
index 11911bf77..000000000
--- a/src/parser/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-set(BACKTRACEPARSER_SRCS
- backtraceparser.cpp
- backtraceparsergdb.cpp
- backtraceparsernull.cpp
- backtraceparserlldb.cpp
- backtraceparser.h
- backtraceparsergdb.h
- backtraceparsernull.h
- backtraceparserlldb.h
-)
-
-ecm_qt_declare_logging_category(
- BACKTRACEPARSER_SRCS
- HEADER drkonqi_parser_debug.h
- IDENTIFIER DRKONQI_PARSER_LOG
- CATEGORY_NAME org.kde.drkonqi.parser
- DESCRIPTION "drkonqi parser"
- EXPORT DRKONQI
-)
-
-add_library(drkonqi_backtrace_parser STATIC ${BACKTRACEPARSER_SRCS})
-target_link_libraries(drkonqi_backtrace_parser PUBLIC Qt::Core)
diff --git a/src/parser/backtraceparser.h b/src/parser/backtraceparser.h
index f3c57f38c..908a414f2 100644
--- a/src/parser/backtraceparser.h
+++ b/src/parser/backtraceparser.h
@@ -12,11 +12,15 @@
#include <QObject>
#include <QSet>
#include <QStringList>
+#include <qqmlintegration.h>
+
class BacktraceParserPrivate;
class BacktraceParser : public QObject
{
Q_OBJECT
+ QML_ELEMENT
+ QML_UNCREATABLE("Only for enums")
Q_DECLARE_PRIVATE(BacktraceParser)
public:
enum Usefulness {
diff --git a/src/qml/BacktracePage.qml b/src/qml/BacktracePage.qml
index 72bc388dc..9fe422d36 100644
--- a/src/qml/BacktracePage.qml
+++ b/src/qml/BacktracePage.qml
@@ -33,7 +33,7 @@ DeveloperPage {
}
icon.name: "go-next"
text: i18nc("@action:button", "Next")
- onTriggered: pageStack.push("qrc:/ui/BugzillaPage.qml")
+ onTriggered: pageStack.push(Qt.resolvedUrl("BugzillaPage.qml"))
}
]
}
diff --git a/src/qml/BugzillaPage.qml b/src/qml/BugzillaPage.qml
index 39337de1f..a6b103b84 100644
--- a/src/qml/BugzillaPage.qml
+++ b/src/qml/BugzillaPage.qml
@@ -19,7 +19,7 @@ Kirigami.Page {
target: bugzilla
function onBugzillaVersionFound() {
pageStack.pop()
- pageStack.push("qrc:/ui/LoginPage.qml")
+ pageStack.push(Qt.resolvedUrl("LoginPage.qml"))
}
function onBugzillaVersionError(error) {
diff --git a/src/qml/ContextPage.qml b/src/qml/ContextPage.qml
index ea0e21945..0c5b82a22 100644
--- a/src/qml/ContextPage.qml
+++ b/src/qml/ContextPage.qml
@@ -98,7 +98,7 @@ If you can't think of any more information, you can close the bug report dialog.
text: i18nc("@action:button", "Next")
onTriggered: {
if (reportInterface.isBugAwarenessPageDataUseful || DrKonqi.ignoreQuality()) {
- pageStack.push("qrc:/ui/BacktracePage.qml")
+ pageStack.push(Qt.resolvedUrl("BacktracePage.qml"))
return
}
problemDialog.open()
diff --git a/src/qml/DeveloperPage.qml b/src/qml/DeveloperPage.qml
index b98c4408d..a37843182 100644
--- a/src/qml/DeveloperPage.qml
+++ b/src/qml/DeveloperPage.qml
@@ -50,7 +50,7 @@ Kirigami.ScrollablePage {
icon.name: "story-editor-symbolic"
text: i18nc("@action Report the bug on this domain", "Report on %1", Globals.bugzillaShortUrl)
tooltip: canReportText !== "" ? canReportText : i18nc("@info:tooltip", "Starts the bug report assistant.")
- onTriggered: pageStack.push("qrc:/ui/WelcomePage.qml")
+ onTriggered: pageStack.push(Qt.resolvedUrl("WelcomePage.qml"))
},
Kirigami.Action {
@@ -108,7 +108,7 @@ installed the proper debug symbol packages and you want to obtain a better backt
RatingItem {
id: ratingItem
- failed: BacktraceGenerator.hasAnyFailure()
+ failed: BacktraceGenerator.hasAnyFailure
loading: BacktraceGenerator.state === BacktraceGenerator.Loading
}
diff --git a/src/qml/LoginPage.qml b/src/qml/LoginPage.qml
index d61c642f3..177578fc8 100644
--- a/src/qml/LoginPage.qml
+++ b/src/qml/LoginPage.qml
@@ -18,7 +18,7 @@ Kirigami.ScrollablePage {
onLoggedInChanged: {
console.log("logged in changed")
if (loggedIn) {
- pageStack.push('qrc:/ui/ReportPage.qml')
+ pageStack.push(Qt.resolvedUrl("ReportPage.qml"))
}
}
diff --git a/src/qml/main.qml b/src/qml/Main.qml
similarity index 98%
rename from src/qml/main.qml
rename to src/qml/Main.qml
index 2d86c804e..069df6a35 100644
--- a/src/qml/main.qml
+++ b/src/qml/Main.qml
@@ -130,6 +130,6 @@ any side effects.</para>`);
pageStack.defaultColumnWidth: appWindow.width // show single page
function goToSentry() {
- pageStack.replace("qrc:/ui/SentryPage.qml")
+ pageStack.replace(Qt.resolvedUrl("SentryPage.qml"))
}
}
diff --git a/src/qml/MainPage.qml b/src/qml/MainPage.qml
index 466944d22..09b15cbc5 100644
--- a/src/qml/MainPage.qml
+++ b/src/qml/MainPage.qml
@@ -63,7 +63,7 @@ Kirigami.Page {
onTriggered: {
reportInterface.setSendWhenReady(true)
reportInterface.sendSentryReport()
- pageStack.push("qrc:/ui/SentryPage.qml")
+ pageStack.push(Qt.resolvedUrl("SentryPage.qml"))
}
}
}
@@ -76,7 +76,7 @@ Kirigami.Page {
action: Kirigami.Action {
icon.name: "code-class-symbolic"
text: i18nc("@action", "See Developer Information")
- onTriggered: pageStack.push("qrc:/ui/DeveloperPage.qml")
+ onTriggered: pageStack.push(Qt.resolvedUrl("DeveloperPage.qml"))
}
}
diff --git a/src/qml/PreviewPage.qml b/src/qml/PreviewPage.qml
index 7d002e956..11e46027d 100644
--- a/src/qml/PreviewPage.qml
+++ b/src/qml/PreviewPage.qml
@@ -37,7 +37,7 @@ Kirigami.ScrollablePage {
Kirigami.Action {
icon.name: "submit"
text: i18nc("@action:button", "Submit")
- onTriggered: pageStack.push("qrc:/ui/SendingPage.qml")
+ onTriggered: pageStack.push(Qt.resolvedUrl("SendingPage.qml"))
}
]
}
diff --git a/src/qml/ReportPage.qml b/src/qml/ReportPage.qml
index ebf524b58..5f5f45261 100644
--- a/src/qml/ReportPage.qml
+++ b/src/qml/ReportPage.qml
@@ -159,7 +159,7 @@ Kirigami.Page {
Kirigami.Action {
icon.name: "preview"
text: i18nc("@action:button", "Preview Report")
- onTriggered: pageStack.push("qrc:/ui/PreviewPage.qml")
+ onTriggered: pageStack.push(Qt.resolvedUrl("PreviewPage.qml"))
}
]
}
diff --git a/src/qml/SendingPage.qml b/src/qml/SendingPage.qml
index 731e52597..cc792e2f1 100644
--- a/src/qml/SendingPage.qml
+++ b/src/qml/SendingPage.qml
@@ -14,7 +14,7 @@ Kirigami.Page {
Connections {
target: reportInterface
function onDone(number) {
- pageStack.replace("qrc:/ui/SentPage.qml", {bugNumber: reportInterface.sentReport})
+ pageStack.replace(Qt.resolvedUrl("SentPage.qml"), {bugNumber: reportInterface.sentReport})
}
function onSendReportError(msg) {
console.log("ERROR" + msg)
diff --git a/src/qml/WelcomePage.qml b/src/qml/WelcomePage.qml
index 54cc8d165..4e33fc422 100644
--- a/src/qml/WelcomePage.qml
+++ b/src/qml/WelcomePage.qml
@@ -44,7 +44,7 @@ to continue reporting this bug it is <emphasis strong='true'>required for you to
icon.name: "document-sign"
text: i18nc("@action:button", "I Agree to be Contacted")
onTriggered: {
- pageStack.push("qrc:/ui/ContextPage.qml")
+ pageStack.push(Qt.resolvedUrl("ContextPage.qml"))
}
}
]
diff --git a/src/qml/qml.qrc b/src/qml/qml.qrc
deleted file mode 100644
index 244550a3b..000000000
--- a/src/qml/qml.qrc
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- SPDX-License-Identifier: CC0-1.0
- SPDX-FileCopyrightText: 2021-2022 Harald Sitter <[email protected]>
--->
-<RCC>
- <qresource prefix="/ui">
- <file>main.qml</file>
- <file>MainPage.qml</file>
- <file>DeveloperPage.qml</file>
- <file>BugzillaPage.qml</file>
- <file>RatingItem.qml</file>
- <file>ReportPage.qml</file>
- <file>WelcomePage.qml</file>
- <file>ContextPage.qml</file>
- <file>LoginPage.qml</file>
- <file>PreviewPage.qml</file>
- <file>BacktracePage.qml</file>
- <file>Globals.qml</file>
- <file>FooterActionBar.qml</file>
- <file>SendingPage.qml</file>
- <file>SentPage.qml</file>
- <file>SentryPage.qml</file>
- <file>MainPageButton.qml</file>
- <file>DownloadSymbolsCheckBox.qml</file>
- <file>qmldir</file>
- </qresource>
-</RCC>
diff --git a/src/qml/qmldir b/src/qml/qmldir
deleted file mode 100644
index 93b709cea..000000000
--- a/src/qml/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-# SPDX-License-Identifier: CC0-1.0
-# SPDX-FileCopyrightText: none
-singleton Globals 1.0 Globals.qml
diff --git a/src/qmlextensions/credentialstore.h b/src/qmlextensions/credentialstore.h
index 5581b1464..f7290ee90 100644
--- a/src/qmlextensions/credentialstore.h
+++ b/src/qmlextensions/credentialstore.h
@@ -5,6 +5,7 @@
#include <QObject>
#include <QWindow>
+#include <qqmlintegration.h>
#include <KWallet>
@@ -13,6 +14,8 @@
class CredentialStore : public QObject
{
Q_OBJECT
+ QML_ELEMENT
+
public:
using QObject::QObject;
diff --git a/src/qmlextensions/doctore.h b/src/qmlextensions/doctore.h
index d1c0e30a1..250d8a350 100644
--- a/src/qmlextensions/doctore.h
+++ b/src/qmlextensions/doctore.h
@@ -5,7 +5,7 @@
#include <QObject>
#include <QWindow>
-
+#include <qqmlintegration.h>
#include "systeminformation.h"
/**
@@ -18,6 +18,9 @@
class Doctore : public QObject
{
Q_OBJECT
+ QML_NAMED_ELEMENT(DrKonqi)
+ QML_SINGLETON
+
// TODO redo DrKonqi so it can work with QML and convert everything to properties.
public:
using QObject::QObject;
diff --git a/src/qmlextensions/platformmodel.h b/src/qmlextensions/platformmodel.h
index 31c0d7f53..9699caad8 100644
--- a/src/qmlextensions/platformmodel.h
+++ b/src/qmlextensions/platformmodel.h
@@ -3,13 +3,15 @@
#pragma once
+#include "bugzillaintegration/bugzillalib.h"
#include <QAbstractListModel>
-
-class BugzillaManager;
+#include <qqmlintegration.h>
class PlatformModel : public QAbstractListModel
{
Q_OBJECT
+ QML_ELEMENT
+
public:
enum class Role {
Name,
diff --git a/src/qmlextensions/reproducibilitymodel.h b/src/qmlextensions/reproducibilitymodel.h
index 3494a8c36..d68e9ac21 100644
--- a/src/qmlextensions/reproducibilitymodel.h
+++ b/src/qmlextensions/reproducibilitymodel.h
@@ -4,12 +4,15 @@
#pragma once
#include <QAbstractListModel>
+#include <qqmlintegration.h>
#include "bugzillaintegration/reportinterface.h"
class ReproducibilityModel : public QAbstractListModel
{
Q_OBJECT
+ QML_ELEMENT
+
public:
enum class Role {
String = Qt::UserRole,
diff --git a/src/settings.kcfgc b/src/settings.kcfgc
index 7ea00a07c..984f936b9 100644
--- a/src/settings.kcfgc
+++ b/src/settings.kcfgc
@@ -6,3 +6,4 @@ Mutators=true
DefaultValueGetters=true
Singleton=true
GenerateProperties=true
+QmlRegistration=true
diff --git a/src/systemd/CMakeLists.txt b/src/systemd/CMakeLists.txt
index b51b117d5..b3abec27d 100644
--- a/src/systemd/CMakeLists.txt
+++ b/src/systemd/CMakeLists.txt
@@ -19,7 +19,7 @@ target_sources(DrKonqiInternal PRIVATE
memorypressure.cpp
)
-target_link_libraries(DrKonqiInternal
+target_link_libraries(DrKonqiInternal PRIVATE
Systemd::systemd
systemd-dbus
)
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 271d8d16c..b45509c1e 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -4,7 +4,7 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII)
if(HAVE_UNAME)
add_executable(lsb_release lsb_release_double.c)
- ecm_add_tests(systeminformationtest.cpp LINK_LIBRARIES Qt::Core Qt::Test DrKonqiInternal)
+ ecm_add_tests(systeminformationtest.cpp LINK_LIBRARIES Qt::Core Qt::Test DrKonqiInternal KF6::CoreAddons)
endif()
add_subdirectory(crashtest)
@@ -12,11 +12,11 @@ add_subdirectory(backtraceparsertest)
add_subdirectory(bugzillalibtest)
add_subdirectory(sentrytest)
-ecm_add_tests(gdbbacktracelinetest.cpp LINK_LIBRARIES Qt::Core Qt::Test drkonqi_backtrace_parser)
+ecm_add_tests(gdbbacktracelinetest.cpp LINK_LIBRARIES Qt::Core Qt::Test DrKonqiInternal)
ecm_add_tests(
linuxprocmapsparsertest.cpp
statusnotifier_activationclosetimertest.cpp
- LINK_LIBRARIES Qt::Core Qt::Test DrKonqiInternal)
+ LINK_LIBRARIES Qt::Core Qt::Test DrKonqiInternal Qt::DBus)
if(NOT APPLE)
if(NOT RUBY_EXECTUABLE)
diff --git a/src/tests/backtraceparsertest/CMakeLists.txt b/src/tests/backtraceparsertest/CMakeLists.txt
index 8788f89e4..a4333f533 100644
--- a/src/tests/backtraceparsertest/CMakeLists.txt
+++ b/src/tests/backtraceparsertest/CMakeLists.txt
@@ -2,9 +2,9 @@ ecm_add_test(
fakebacktracegenerator.cpp
backtraceparsertest.cpp
TEST_NAME backtraceparsertest
- LINK_LIBRARIES Qt::Test Qt::Core KF6::KIOWidgets drkonqi_backtrace_parser
+ LINK_LIBRARIES Qt::Test Qt::Core KF6::KIOWidgets DrKonqiInternal
)
add_executable(backtraceparsertest_manual fakebacktracegenerator.cpp backtraceparsertest_manual.cpp)
-target_link_libraries(backtraceparsertest_manual Qt::Core KF6::I18n KF6::KIOWidgets drkonqi_backtrace_parser)
+target_link_libraries(backtraceparsertest_manual Qt::Core KF6::I18n KF6::KIOWidgets DrKonqiInternal)
ecm_mark_as_test(backtraceparsertest_manual)
ecm_mark_nongui_executable(backtraceparsertest_manual)
diff --git a/src/tests/bugzillalibtest/CMakeLists.txt b/src/tests/bugzillalibtest/CMakeLists.txt
index 9e08734f7..eceb53872 100644
--- a/src/tests/bugzillalibtest/CMakeLists.txt
+++ b/src/tests/bugzillalibtest/CMakeLists.txt
@@ -10,4 +10,4 @@ ecm_qt_declare_logging_category(
add_executable(bugzillalibtest ${bugzillalibtest_SRCS})
ecm_mark_as_test(bugzillalibtest)
-target_link_libraries(bugzillalibtest KF6::KIOWidgets KF6::I18n qbugzilla DrKonqiInternal)
+target_link_libraries(bugzillalibtest KF6::KIOWidgets KF6::I18n qbugzilla DrKonqiInternal Qt::Qml)