[libcalamaresui] Move QML-related directory functions to Qml.cpp

main
Adriaan de Groot 5 years ago
parent 4491fb8c27
commit 6dffec2730

@ -32,6 +32,9 @@
#include "utils/CalamaresUtilsSystem.h" #include "utils/CalamaresUtilsSystem.h"
#include "utils/Dirs.h" #include "utils/Dirs.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#ifdef WITH_QML
#include "utils/Qml.h"
#endif
#include "utils/Retranslator.h" #include "utils/Retranslator.h"
#include "viewpages/ViewStep.h" #include "viewpages/ViewStep.h"

@ -42,7 +42,6 @@ namespace CalamaresUtils
{ {
static QDir s_appDataDir( CMAKE_INSTALL_FULL_DATADIR ); 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_isAppDataDirOverridden = false;
static bool s_haveExtraDirs = false; static bool s_haveExtraDirs = false;
@ -79,13 +78,6 @@ isWritableDir( const QDir& dir )
} }
QDir
qmlModulesDir()
{
return s_qmlModulesDir;
}
void void
setAppDataDir( const QDir& dir ) setAppDataDir( const QDir& dir )
{ {
@ -200,11 +192,4 @@ appLogDir()
return QDir::temp(); return QDir::temp();
} }
void
setQmlModulesDir( const QDir& dir )
{
s_qmlModulesDir = dir;
}
} // namespace CalamaresUtils } // namespace CalamaresUtils

@ -31,8 +31,6 @@
namespace CalamaresUtils namespace CalamaresUtils
{ {
DLLEXPORT QDir qmlModulesDir();
/** /**
* @brief appDataDir returns the directory with common application data. * @brief appDataDir returns the directory with common application data.
* Defaults to CMAKE_INSTALL_FULL_DATADIR (usually /usr/share/calamares). * Defaults to CMAKE_INSTALL_FULL_DATADIR (usually /usr/share/calamares).
@ -57,8 +55,6 @@ DLLEXPORT QDir systemLibDir();
DLLEXPORT void setAppDataDir( const QDir& dir ); DLLEXPORT void setAppDataDir( const QDir& dir );
DLLEXPORT bool isAppDataDirOverridden(); DLLEXPORT bool isAppDataDirOverridden();
DLLEXPORT void setQmlModulesDir( const QDir& dir );
/** @brief Setup extra config and data dirs from the XDG variables. /** @brief Setup extra config and data dirs from the XDG variables.
*/ */
DLLEXPORT void setXdgDirs(); DLLEXPORT void setXdgDirs();

@ -30,8 +30,22 @@
#include <QString> #include <QString>
#include <QVariant> #include <QVariant>
static QDir s_qmlModulesDir( QString( CMAKE_INSTALL_FULL_DATADIR ) + "/qml" );
namespace CalamaresUtils namespace CalamaresUtils
{ {
QDir
qmlModulesDir()
{
return s_qmlModulesDir;
}
void
setQmlModulesDir( const QDir& dir )
{
s_qmlModulesDir = dir;
}
void void
callQmlFunction( QQuickItem* qmlObject, const char* method ) callQmlFunction( QQuickItem* qmlObject, const char* method )

@ -24,10 +24,19 @@
#include "modulesystem/InstanceKey.h" #include "modulesystem/InstanceKey.h"
#include "utils/NamedEnum.h" #include "utils/NamedEnum.h"
#include <QDir>
class QQuickItem; class QQuickItem;
namespace CalamaresUtils 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 /** @brief Sets up global Calamares models for QML
* *
* This needs to be called at least once to make the global Calamares * This needs to be called at least once to make the global Calamares
@ -66,7 +75,7 @@ enum class QmlSearch
Both Both
}; };
///@brief Names for the search terms (in config files) /// @brief Names for the search terms (in config files)
UIDLLEXPORT const NamedEnumTable< QmlSearch >& qmlSearchNames(); UIDLLEXPORT const NamedEnumTable< QmlSearch >& qmlSearchNames();
/** @brief Find a suitable QML file, given the search method and name hints /** @brief Find a suitable QML file, given the search method and name hints

Loading…
Cancel
Save