From ac52888b0dea2db5f9645a6cbc3afa951ea2140e Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Sun, 31 Mar 2024 15:17:50 +0300 Subject: [PATCH] refactor: use default qml library paths previous implementation stores data in share instead of lib (I guess, I had issues with using default paths?). Let's use normal paths instead --- .../package/contents/ui/about.qml | 3 ++- .../package/contents/ui/advanced.qml | 3 ++- .../package/contents/ui/appearance.qml | 4 +-- .../package/contents/ui/dataengine.qml | 3 ++- .../package/contents/ui/main.qml | 4 +-- .../awesome-widget/package/contents/ui/qmldir | 27 ------------------- .../package/contents/ui/tooltip.qml | 3 ++- .../package/contents/ui/widget.qml | 4 +-- .../package/contents/ui/about.qml | 3 ++- .../package/contents/ui/activeapp.qml | 4 +-- .../package/contents/ui/advanced.qml | 3 ++- .../package/contents/ui/inactiveapp.qml | 4 +-- .../package/contents/ui/main.qml | 4 +-- .../desktop-panel/package/contents/ui/qmldir | 27 ------------------- .../package/contents/ui/widget.qml | 4 +-- sources/qml/CMakeLists.txt | 9 ++----- sources/qml/qmldir | 23 ++++++++++++++++ sources/qml/qmldir.in | 27 ------------------- 18 files changed, 51 insertions(+), 108 deletions(-) delete mode 100644 sources/awesome-widget/package/contents/ui/qmldir delete mode 100644 sources/desktop-panel/package/contents/ui/qmldir create mode 100644 sources/qml/qmldir delete mode 100644 sources/qml/qmldir.in diff --git a/sources/awesome-widget/package/contents/ui/about.qml b/sources/awesome-widget/package/contents/ui/about.qml index abbdbd15..0cad6126 100644 --- a/sources/awesome-widget/package/contents/ui/about.qml +++ b/sources/awesome-widget/package/contents/ui/about.qml @@ -18,7 +18,8 @@ import QtQuick 2.15 import org.kde.kcmutils as KCM -import org.kde.plasma.private.awesomewidget 1.0 +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.awesomewidget KCM.SimpleKCM { diff --git a/sources/awesome-widget/package/contents/ui/advanced.qml b/sources/awesome-widget/package/contents/ui/advanced.qml index 65af7111..4279f989 100644 --- a/sources/awesome-widget/package/contents/ui/advanced.qml +++ b/sources/awesome-widget/package/contents/ui/advanced.qml @@ -19,7 +19,8 @@ import QtQuick 2.15 import QtQuick.Controls import org.kde.kcmutils as KCM -import org.kde.plasma.private.awesomewidget 1.0 +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.awesomewidget KCM.SimpleKCM { diff --git a/sources/awesome-widget/package/contents/ui/appearance.qml b/sources/awesome-widget/package/contents/ui/appearance.qml index bbc0afda..03457151 100644 --- a/sources/awesome-widget/package/contents/ui/appearance.qml +++ b/sources/awesome-widget/package/contents/ui/appearance.qml @@ -18,8 +18,8 @@ import QtQuick 2.15 import org.kde.kcmutils as KCM -import org.kde.plasma.private.awesomewidget 1.0 -import "." +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.awesomewidget KCM.SimpleKCM { diff --git a/sources/awesome-widget/package/contents/ui/dataengine.qml b/sources/awesome-widget/package/contents/ui/dataengine.qml index 31a180c0..d0594074 100644 --- a/sources/awesome-widget/package/contents/ui/dataengine.qml +++ b/sources/awesome-widget/package/contents/ui/dataengine.qml @@ -19,7 +19,8 @@ import QtQuick 2.15 import QtQuick.Controls import org.kde.kcmutils as KCM -import org.kde.plasma.private.awesomewidget 1.0 +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.awesomewidget KCM.SimpleKCM { diff --git a/sources/awesome-widget/package/contents/ui/main.qml b/sources/awesome-widget/package/contents/ui/main.qml index d2184d26..fc19e584 100644 --- a/sources/awesome-widget/package/contents/ui/main.qml +++ b/sources/awesome-widget/package/contents/ui/main.qml @@ -22,8 +22,8 @@ import QtQuick.Layouts import org.kde.plasma.core as PlasmaCore import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.private.awesomewidget 1.0 -import "." +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.awesomewidget PlasmoidItem { diff --git a/sources/awesome-widget/package/contents/ui/qmldir b/sources/awesome-widget/package/contents/ui/qmldir deleted file mode 100644 index 2f19ff42..00000000 --- a/sources/awesome-widget/package/contents/ui/qmldir +++ /dev/null @@ -1,27 +0,0 @@ -# Do not edit qmldir directly it will be overrided during compilation, -# edit qml/qmldir.in file instead. - - -# common QML constants -singleton General 1.0 file:///usr/share/awesomewidgets/qml/General.qml - -# custom QML UI classes -AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml -AWExtensions file:///usr/share/awesomewidgets/qml/AWExtensions.qml -AWInfoLabel file:///usr/share/awesomewidgets/qml/AWInfoLabel.qml -AWTagSelector file:///usr/share/awesomewidgets/qml/AWTagSelector.qml -AWTextEditor file:///usr/share/awesomewidgets/qml/AWTextEditor.qml -BugReport file:///usr/share/awesomewidgets/qml/BugReport.qml -ButtonSelector file:///usr/share/awesomewidgets/qml/ButtonSelector.qml -CheckBoxSelector file:///usr/share/awesomewidgets/qml/CheckBoxSelector.qml -ColorSelector file:///usr/share/awesomewidgets/qml/ColorSelector.qml -ComboBoxSelector file:///usr/share/awesomewidgets/qml/ComboBoxSelector.qml -ExportDialog file:///usr/share/awesomewidgets/qml/ExportDialog.qml -FontSelector file:///usr/share/awesomewidgets/qml/FontSelector.qml -HtmlDefaultFunctionsBar file:///usr/share/awesomewidgets/qml/HtmlDefaultFunctionsBar.qml -HtmlEditorButton file:///usr/share/awesomewidgets/qml/HtmlEditorButton.qml -HtmlEditorColor file:///usr/share/awesomewidgets/qml/HtmlEditorColor.qml -HtmlEditorFont file:///usr/share/awesomewidgets/qml/HtmlEditorFont.qml -ImportDialog file:///usr/share/awesomewidgets/qml/ImportDialog.qml -IntegerSelector file:///usr/share/awesomewidgets/qml/IntegerSelector.qml -LineSelector file:///usr/share/awesomewidgets/qml/LineSelector.qml diff --git a/sources/awesome-widget/package/contents/ui/tooltip.qml b/sources/awesome-widget/package/contents/ui/tooltip.qml index ff0c6375..c828a153 100644 --- a/sources/awesome-widget/package/contents/ui/tooltip.qml +++ b/sources/awesome-widget/package/contents/ui/tooltip.qml @@ -19,7 +19,8 @@ import QtQuick 2.15 import QtQuick.Controls import org.kde.kcmutils as KCM -import org.kde.plasma.private.awesomewidget 1.0 +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.awesomewidget KCM.SimpleKCM { diff --git a/sources/awesome-widget/package/contents/ui/widget.qml b/sources/awesome-widget/package/contents/ui/widget.qml index c65d3f4b..02cdb99f 100644 --- a/sources/awesome-widget/package/contents/ui/widget.qml +++ b/sources/awesome-widget/package/contents/ui/widget.qml @@ -19,8 +19,8 @@ import QtQuick 2.15 import QtQuick.Controls import org.kde.kcmutils as KCM -import org.kde.plasma.private.awesomewidget 1.0 -import "." +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.awesomewidget KCM.SimpleKCM { diff --git a/sources/desktop-panel/package/contents/ui/about.qml b/sources/desktop-panel/package/contents/ui/about.qml index 2b6c5835..08537541 100644 --- a/sources/desktop-panel/package/contents/ui/about.qml +++ b/sources/desktop-panel/package/contents/ui/about.qml @@ -18,7 +18,8 @@ import QtQuick 2.15 import org.kde.kcmutils as KCM -import org.kde.plasma.private.desktoppanel 1.0 +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.desktoppanel KCM.SimpleKCM { diff --git a/sources/desktop-panel/package/contents/ui/activeapp.qml b/sources/desktop-panel/package/contents/ui/activeapp.qml index 10f509f9..fb9c717d 100644 --- a/sources/desktop-panel/package/contents/ui/activeapp.qml +++ b/sources/desktop-panel/package/contents/ui/activeapp.qml @@ -18,8 +18,8 @@ import QtQuick 2.15 import org.kde.kcmutils as KCM -import org.kde.plasma.private.desktoppanel 1.0 -import "." +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.desktoppanel KCM.SimpleKCM { diff --git a/sources/desktop-panel/package/contents/ui/advanced.qml b/sources/desktop-panel/package/contents/ui/advanced.qml index 783bc1b9..2c3590d2 100644 --- a/sources/desktop-panel/package/contents/ui/advanced.qml +++ b/sources/desktop-panel/package/contents/ui/advanced.qml @@ -19,7 +19,8 @@ import QtQuick 2.15 import QtQuick.Controls import org.kde.kcmutils as KCM -import org.kde.plasma.private.desktoppanel 1.0 +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.desktoppanel KCM.SimpleKCM { diff --git a/sources/desktop-panel/package/contents/ui/inactiveapp.qml b/sources/desktop-panel/package/contents/ui/inactiveapp.qml index d787cee5..cd717b0e 100644 --- a/sources/desktop-panel/package/contents/ui/inactiveapp.qml +++ b/sources/desktop-panel/package/contents/ui/inactiveapp.qml @@ -18,8 +18,8 @@ import QtQuick 2.15 import org.kde.kcmutils as KCM -import org.kde.plasma.private.desktoppanel 1.0 -import "." +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.desktoppanel KCM.SimpleKCM { diff --git a/sources/desktop-panel/package/contents/ui/main.qml b/sources/desktop-panel/package/contents/ui/main.qml index 6db0ff14..57cb47b6 100644 --- a/sources/desktop-panel/package/contents/ui/main.qml +++ b/sources/desktop-panel/package/contents/ui/main.qml @@ -21,8 +21,8 @@ import QtQuick.Layouts import org.kde.plasma.core as PlasmaCore import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.private.desktoppanel 1.0 -import "." +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.desktoppanel PlasmoidItem { diff --git a/sources/desktop-panel/package/contents/ui/qmldir b/sources/desktop-panel/package/contents/ui/qmldir deleted file mode 100644 index 2f19ff42..00000000 --- a/sources/desktop-panel/package/contents/ui/qmldir +++ /dev/null @@ -1,27 +0,0 @@ -# Do not edit qmldir directly it will be overrided during compilation, -# edit qml/qmldir.in file instead. - - -# common QML constants -singleton General 1.0 file:///usr/share/awesomewidgets/qml/General.qml - -# custom QML UI classes -AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml -AWExtensions file:///usr/share/awesomewidgets/qml/AWExtensions.qml -AWInfoLabel file:///usr/share/awesomewidgets/qml/AWInfoLabel.qml -AWTagSelector file:///usr/share/awesomewidgets/qml/AWTagSelector.qml -AWTextEditor file:///usr/share/awesomewidgets/qml/AWTextEditor.qml -BugReport file:///usr/share/awesomewidgets/qml/BugReport.qml -ButtonSelector file:///usr/share/awesomewidgets/qml/ButtonSelector.qml -CheckBoxSelector file:///usr/share/awesomewidgets/qml/CheckBoxSelector.qml -ColorSelector file:///usr/share/awesomewidgets/qml/ColorSelector.qml -ComboBoxSelector file:///usr/share/awesomewidgets/qml/ComboBoxSelector.qml -ExportDialog file:///usr/share/awesomewidgets/qml/ExportDialog.qml -FontSelector file:///usr/share/awesomewidgets/qml/FontSelector.qml -HtmlDefaultFunctionsBar file:///usr/share/awesomewidgets/qml/HtmlDefaultFunctionsBar.qml -HtmlEditorButton file:///usr/share/awesomewidgets/qml/HtmlEditorButton.qml -HtmlEditorColor file:///usr/share/awesomewidgets/qml/HtmlEditorColor.qml -HtmlEditorFont file:///usr/share/awesomewidgets/qml/HtmlEditorFont.qml -ImportDialog file:///usr/share/awesomewidgets/qml/ImportDialog.qml -IntegerSelector file:///usr/share/awesomewidgets/qml/IntegerSelector.qml -LineSelector file:///usr/share/awesomewidgets/qml/LineSelector.qml diff --git a/sources/desktop-panel/package/contents/ui/widget.qml b/sources/desktop-panel/package/contents/ui/widget.qml index 98f8ccda..74d22045 100644 --- a/sources/desktop-panel/package/contents/ui/widget.qml +++ b/sources/desktop-panel/package/contents/ui/widget.qml @@ -18,8 +18,8 @@ import QtQuick 2.15 import org.kde.kcmutils as KCM -import org.kde.plasma.private.desktoppanel 1.0 -import "." +import org.kde.plasma.awesomewidgets +import org.kde.plasma.private.desktoppanel KCM.SimpleKCM { diff --git a/sources/qml/CMakeLists.txt b/sources/qml/CMakeLists.txt index 29a6c959..e16b13d6 100644 --- a/sources/qml/CMakeLists.txt +++ b/sources/qml/CMakeLists.txt @@ -1,12 +1,7 @@ set(SUBPROJECT awesomewidgets-qml) message(STATUS "Subproject ${SUBPROJECT}") -file(GLOB SUBPROJECT_SOURCE *.qml) -file(GLOB SUBPROJECT_QMLDIR_IN qmldir.in) - -# prepare -configure_file(${SUBPROJECT_QMLDIR_IN} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/package/contents/ui/qmldir) -configure_file(${SUBPROJECT_QMLDIR_IN} ${CMAKE_CURRENT_SOURCE_DIR}/../desktop-panel/package/contents/ui/qmldir) +file(GLOB SUBPROJECT_SOURCE *.qml qmldir) # install -install(FILES ${SUBPROJECT_SOURCE} DESTINATION ${KDE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/qml) +install(FILES ${SUBPROJECT_SOURCE} DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/${PROJECT_NAME}) diff --git a/sources/qml/qmldir b/sources/qml/qmldir new file mode 100644 index 00000000..827b4220 --- /dev/null +++ b/sources/qml/qmldir @@ -0,0 +1,23 @@ +# common QML constants +singleton General 1.0 General.qml + +# custom QML UI classes +AboutTab AboutTab.qml +AWExtensions AWExtensions.qml +AWInfoLabel AWInfoLabel.qml +AWTagSelector AWTagSelector.qml +AWTextEditor AWTextEditor.qml +BugReport BugReport.qml +ButtonSelector ButtonSelector.qml +CheckBoxSelector CheckBoxSelector.qml +ColorSelector ColorSelector.qml +ComboBoxSelector ComboBoxSelector.qml +ExportDialog ExportDialog.qml +FontSelector FontSelector.qml +HtmlDefaultFunctionsBar HtmlDefaultFunctionsBar.qml +HtmlEditorButton HtmlEditorButton.qml +HtmlEditorColor HtmlEditorColor.qml +HtmlEditorFont HtmlEditorFont.qml +ImportDialog ImportDialog.qml +IntegerSelector IntegerSelector.qml +LineSelector LineSelector.qml diff --git a/sources/qml/qmldir.in b/sources/qml/qmldir.in deleted file mode 100644 index 9930b153..00000000 --- a/sources/qml/qmldir.in +++ /dev/null @@ -1,27 +0,0 @@ -# Do not edit qmldir directly it will be overrided during compilation, -# edit qml/qmldir.in file instead. - - -# common QML constants -singleton General 1.0 file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/General.qml - -# custom QML UI classes -AboutTab file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/AboutTab.qml -AWExtensions file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/AWExtensions.qml -AWInfoLabel file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/AWInfoLabel.qml -AWTagSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/AWTagSelector.qml -AWTextEditor file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/AWTextEditor.qml -BugReport file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/BugReport.qml -ButtonSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/ButtonSelector.qml -CheckBoxSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/CheckBoxSelector.qml -ColorSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/ColorSelector.qml -ComboBoxSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/ComboBoxSelector.qml -ExportDialog file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/ExportDialog.qml -FontSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/FontSelector.qml -HtmlDefaultFunctionsBar file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/HtmlDefaultFunctionsBar.qml -HtmlEditorButton file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/HtmlEditorButton.qml -HtmlEditorColor file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/HtmlEditorColor.qml -HtmlEditorFont file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/HtmlEditorFont.qml -ImportDialog file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/ImportDialog.qml -IntegerSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/IntegerSelector.qml -LineSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/LineSelector.qml