diff --git a/src/calamares/CalamaresApplication.cpp b/src/calamares/CalamaresApplication.cpp index 5ef97a6a3..e90a67bb3 100644 --- a/src/calamares/CalamaresApplication.cpp +++ b/src/calamares/CalamaresApplication.cpp @@ -32,6 +32,9 @@ #include "utils/CalamaresUtilsSystem.h" #include "utils/Dirs.h" #include "utils/Logger.h" +#ifdef WITH_QML +#include "utils/Qml.h" +#endif #include "utils/Retranslator.h" #include "viewpages/ViewStep.h" diff --git a/src/libcalamares/utils/Dirs.cpp b/src/libcalamares/utils/Dirs.cpp index ca569490f..bb48477da 100644 --- a/src/libcalamares/utils/Dirs.cpp +++ b/src/libcalamares/utils/Dirs.cpp @@ -42,7 +42,6 @@ namespace CalamaresUtils { static QDir s_appDataDir( CMAKE_INSTALL_FULL_DATADIR ); -static QDir s_qmlModulesDir( QString( CMAKE_INSTALL_FULL_DATADIR ) + "/qml" ); static bool s_isAppDataDirOverridden = false; static bool s_haveExtraDirs = false; @@ -79,13 +78,6 @@ isWritableDir( const QDir& dir ) } -QDir -qmlModulesDir() -{ - return s_qmlModulesDir; -} - - void setAppDataDir( const QDir& dir ) { @@ -200,11 +192,4 @@ appLogDir() return QDir::temp(); } - -void -setQmlModulesDir( const QDir& dir ) -{ - s_qmlModulesDir = dir; -} - } // namespace CalamaresUtils diff --git a/src/libcalamares/utils/Dirs.h b/src/libcalamares/utils/Dirs.h index a63e679da..79c07a957 100644 --- a/src/libcalamares/utils/Dirs.h +++ b/src/libcalamares/utils/Dirs.h @@ -31,8 +31,6 @@ namespace CalamaresUtils { -DLLEXPORT QDir qmlModulesDir(); - /** * @brief appDataDir returns the directory with common application data. * Defaults to CMAKE_INSTALL_FULL_DATADIR (usually /usr/share/calamares). @@ -57,8 +55,6 @@ DLLEXPORT QDir systemLibDir(); DLLEXPORT void setAppDataDir( const QDir& dir ); DLLEXPORT bool isAppDataDirOverridden(); -DLLEXPORT void setQmlModulesDir( const QDir& dir ); - /** @brief Setup extra config and data dirs from the XDG variables. */ DLLEXPORT void setXdgDirs(); diff --git a/src/libcalamaresui/utils/Qml.cpp b/src/libcalamaresui/utils/Qml.cpp index 2837dfb5e..eabbf8d33 100644 --- a/src/libcalamaresui/utils/Qml.cpp +++ b/src/libcalamaresui/utils/Qml.cpp @@ -30,8 +30,22 @@ #include #include +static QDir s_qmlModulesDir( QString( CMAKE_INSTALL_FULL_DATADIR ) + "/qml" ); + namespace CalamaresUtils { +QDir +qmlModulesDir() +{ + return s_qmlModulesDir; +} + +void +setQmlModulesDir( const QDir& dir ) +{ + s_qmlModulesDir = dir; +} + void callQmlFunction( QQuickItem* qmlObject, const char* method ) diff --git a/src/libcalamaresui/utils/Qml.h b/src/libcalamaresui/utils/Qml.h index d9d226034..2da36633a 100644 --- a/src/libcalamaresui/utils/Qml.h +++ b/src/libcalamaresui/utils/Qml.h @@ -24,10 +24,19 @@ #include "modulesystem/InstanceKey.h" #include "utils/NamedEnum.h" +#include + class QQuickItem; namespace CalamaresUtils { +/// @brief the extra directory where Calamares searches for QML files +UIDLLEXPORT QDir qmlModulesDir(); +/// @brief sets specific directory for searching for QML files +UIDLLEXPORT void setQmlModulesDir( const QDir& dir ); + + + /** @brief Sets up global Calamares models for QML * * This needs to be called at least once to make the global Calamares @@ -66,7 +75,7 @@ enum class QmlSearch Both }; -///@brief Names for the search terms (in config files) +/// @brief Names for the search terms (in config files) UIDLLEXPORT const NamedEnumTable< QmlSearch >& qmlSearchNames(); /** @brief Find a suitable QML file, given the search method and name hints