[libcalamaresui] Move QML-related directory functions to Qml.cpp
This commit is contained in:
parent
4491fb8c27
commit
6dffec2730
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -30,8 +30,22 @@
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
|
||||
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 )
|
||||
|
@ -24,10 +24,19 @@
|
||||
#include "modulesystem/InstanceKey.h"
|
||||
#include "utils/NamedEnum.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user