diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index c34279603..80cef5142 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -1,5 +1,3 @@
-qt_add_resources(kdeconnect_SRCS resources.qrc)
-
qt_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
ecm_setup_version(${PROJECT_VERSION}
@@ -29,7 +27,26 @@ add_executable(kdeconnect-app
${kdeconnect_SRCS}
${kdeconnect_custom_icons_SRCS}
)
-target_link_libraries(kdeconnect-app Qt::Quick Qt::QuickControls2 Qt::Widgets KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::KCMUtils)
+
+ecm_add_qml_module(kdeconnect-app URI org.kde.kdeconnect.app)
+
+ecm_target_qml_sources(kdeconnect-app SOURCES
+ qml/Main.qml
+ qml/mpris.qml
+ qml/mousepad.qml
+ qml/presentationRemote.qml
+ qml/PluginItem.qml
+ qml/DevicePage.qml
+ qml/FindDevicesPage.qml
+ qml/runcommand.qml
+ qml/volume.qml
+ qml/MprisSlider.qml
+ qml/PluginSettings.qml
+ qml/PluginInfoPage.qml
+ qml/Settings.qml
+)
+
+target_link_libraries(kdeconnect-app PRIVATE Qt::Quick Qt::QuickControls2 Qt::Widgets KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::KCMUtils)
install(TARGETS kdeconnect-app ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.kde.kdeconnect.app.desktop DESTINATION ${KDE_INSTALL_APPDIR})
diff --git a/app/main.cpp b/app/main.cpp
index b0043adc8..de083ce32 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
QQmlApplicationEngine engine;
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
- engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
+ engine.loadFromModule("org.kde.kdeconnect.app", "Main");
return app.exec();
}
diff --git a/app/qml/main.qml b/app/qml/Main.qml
similarity index 100%
rename from app/qml/main.qml
rename to app/qml/Main.qml
diff --git a/app/resources.qrc b/app/resources.qrc
deleted file mode 100644
index b77b92983..000000000
--- a/app/resources.qrc
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
- qml/main.qml
- qml/mpris.qml
- qml/mousepad.qml
- qml/presentationRemote.qml
-
- qml/PluginItem.qml
- qml/DevicePage.qml
- qml/FindDevicesPage.qml
- qml/runcommand.qml
- qml/volume.qml
- qml/MprisSlider.qml
- qml/PluginSettings.qml
- qml/PluginInfoPage.qml
- qml/Settings.qml
-
-
diff --git a/smsapp/CMakeLists.txt b/smsapp/CMakeLists.txt
index 345f37f21..97bb550dd 100644
--- a/smsapp/CMakeLists.txt
+++ b/smsapp/CMakeLists.txt
@@ -38,13 +38,24 @@ add_executable(kdeconnect-sms
conversationlistmodel.cpp
conversationmodel.cpp
conversationssortfilterproxymodel.cpp
- resources.qrc
thumbnailsprovider.cpp
attachmentinfo.cpp
${kdeconnect_custom_icons_SRCS}
)
-target_link_libraries(kdeconnect-sms
+ecm_add_qml_module(kdeconnect-sms URI org.kde.kdeconnect.sms)
+
+ecm_target_qml_sources(kdeconnect-sms SOURCES
+ qml/Main.qml
+ qml/ConversationList.qml
+ qml/ConversationDisplay.qml
+ qml/ChatMessage.qml
+ qml/MessageAttachments.qml
+ qml/AttachmentViewer.qml
+ qml/SendingArea.qml
+)
+
+target_link_libraries(kdeconnect-sms PRIVATE
kdeconnectsmshelper
kdeconnectinterfaces
kdeconnectversion
diff --git a/smsapp/main.cpp b/smsapp/main.cpp
index 312dc1bb4..c31e1e7fa 100644
--- a/smsapp/main.cpp
+++ b/smsapp/main.cpp
@@ -108,7 +108,7 @@ int main(int argc, char *argv[])
QQmlApplicationEngine engine;
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
engine.addImageProvider(QStringLiteral("thumbnailsProvider"), new ThumbnailsProvider);
- engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
+ engine.loadFromModule("org.kde.kdeconnect.sms", "Main");
return app.exec();
}
diff --git a/smsapp/qml/main.qml b/smsapp/qml/Main.qml
similarity index 100%
rename from smsapp/qml/main.qml
rename to smsapp/qml/Main.qml
diff --git a/smsapp/resources.qrc b/smsapp/resources.qrc
deleted file mode 100644
index 3d2693c6e..000000000
--- a/smsapp/resources.qrc
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
- qml/main.qml
- qml/ConversationList.qml
- qml/ConversationDisplay.qml
- qml/ChatMessage.qml
- qml/MessageAttachments.qml
- qml/AttachmentViewer.qml
- qml/SendingArea.qml
-
-