Fix build with -no-feature-settings
Change-Id: I3667e087b13fba6f9804b76d2d0bed2ffefbddbe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a36782cfe8
)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
parent
ab19b7d0d5
commit
f9dac01d00
|
@ -15,8 +15,6 @@ qt_internal_add_qml_module(QmlCore
|
|||
qqmlstandardpaths_p.h
|
||||
qqmlstandardpaths.cpp
|
||||
qqmlcoreglobal_p.h
|
||||
qqmlsettings_p.h
|
||||
qqmlsettings.cpp
|
||||
DEFINES
|
||||
QT_BUILD_QML_CORE_LIB
|
||||
PUBLIC_LIBRARIES
|
||||
|
@ -26,6 +24,12 @@ qt_internal_add_qml_module(QmlCore
|
|||
GENERATE_PRIVATE_CPP_EXPORTS
|
||||
)
|
||||
|
||||
qt_internal_extend_target(QmlCore CONDITION QT_FEATURE_settings
|
||||
SOURCES
|
||||
qqmlsettings_p.h
|
||||
qqmlsettings.cpp
|
||||
)
|
||||
|
||||
qt_internal_add_docs(QmlCore
|
||||
doc/qtqmlcore.qdocconf
|
||||
)
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
|
||||
#include "qquickimaginestyle_p.h"
|
||||
|
||||
#if QT_CONFIG(settings)
|
||||
#include <QtCore/qsettings.h>
|
||||
#endif
|
||||
#include <QtQuickControls2/private/qquickstyle_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
#include "qquickmaterialstyle_p.h"
|
||||
|
||||
#include <QtCore/qdebug.h>
|
||||
#if QT_CONFIG(settings)
|
||||
#include <QtCore/qsettings.h>
|
||||
#endif
|
||||
#include <QtQml/qqmlinfo.h>
|
||||
#include <QtQuickControls2/private/qquickstyle_p.h>
|
||||
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
#include <QtCore/qdir.h>
|
||||
#include <QtCore/qfile.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
#if QT_CONFIG(settings)
|
||||
#include <QtCore/qsettings.h>
|
||||
#endif
|
||||
#include <QtCore/qfileselector.h>
|
||||
#include <QtCore/qlibraryinfo.h>
|
||||
#include <QtCore/qloggingcategory.h>
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
#include "qquickuniversalstyle_p.h"
|
||||
|
||||
#include <QtCore/qdebug.h>
|
||||
#if QT_CONFIG(settings)
|
||||
#include <QtCore/qsettings.h>
|
||||
#endif
|
||||
#include <QtQml/qqmlinfo.h>
|
||||
#include <QtQuickControls2/private/qquickstyle_p.h>
|
||||
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
#include <qtextformat.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qdir.h>
|
||||
#if QT_CONFIG(settings)
|
||||
#include <qsettings.h>
|
||||
#endif
|
||||
#include <qvariant.h>
|
||||
#include <qpixmapcache.h>
|
||||
#include <qmatrix4x4.h>
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
#include <QtCore/qdir.h>
|
||||
#include <QtCore/qfileinfo.h>
|
||||
#include <QtCore/qset.h>
|
||||
#if QT_CONFIG(settings)
|
||||
#include <QtCore/qsettings.h>
|
||||
#endif
|
||||
#include <QtCore/qstandardpaths.h>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
@ -21,6 +23,7 @@ void QQmlToolingSettings::addOption(const QString &name, QVariant defaultValue)
|
|||
|
||||
bool QQmlToolingSettings::read(const QString &settingsFilePath)
|
||||
{
|
||||
#if QT_CONFIG(settings)
|
||||
if (!QFileInfo::exists(settingsFilePath))
|
||||
return false;
|
||||
|
||||
|
@ -35,10 +38,14 @@ bool QQmlToolingSettings::read(const QString &settingsFilePath)
|
|||
m_currentSettingsPath = settingsFilePath;
|
||||
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool QQmlToolingSettings::writeDefaults() const
|
||||
{
|
||||
#if QT_CONFIG(settings)
|
||||
const QString path = QFileInfo(u".%1.ini"_s.arg(m_toolName)).absoluteFilePath();
|
||||
|
||||
QSettings settings(path, QSettings::IniFormat);
|
||||
|
@ -56,10 +63,14 @@ bool QQmlToolingSettings::writeDefaults() const
|
|||
|
||||
qInfo() << "Wrote default settings to" << path;
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool QQmlToolingSettings::search(const QString &path)
|
||||
{
|
||||
#if QT_CONFIG(settings)
|
||||
QFileInfo fileInfo(path);
|
||||
QDir dir(fileInfo.isDir() ? path : fileInfo.dir());
|
||||
|
||||
|
@ -105,6 +116,7 @@ bool QQmlToolingSettings::search(const QString &path)
|
|||
for (const QString &dir : std::as_const(dirs))
|
||||
m_seenDirectories[dir] = QString();
|
||||
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue