Merge remote-tracking branch 'origin/5.11' into 5.12

Conflicts:
	src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm

Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
This commit is contained in:
Liang Qi 2018-11-19 12:42:10 +01:00
commit 4d180586cd
27 changed files with 88 additions and 87 deletions

View File

@ -127,11 +127,13 @@
#define QT_FEATURE_commandlineparser -1 #define QT_FEATURE_commandlineparser -1
#define QT_NO_COMPRESS #define QT_NO_COMPRESS
#define QT_JSON_READONLY #define QT_JSON_READONLY
#define QT_FEATURE_settings 1
#define QT_NO_STANDARDPATHS #define QT_NO_STANDARDPATHS
#define QT_FEATURE_textcodec -1 #define QT_FEATURE_textcodec -1
#else #else
#define QT_FEATURE_codecs -1 #define QT_FEATURE_codecs -1
#define QT_FEATURE_commandlineparser 1 #define QT_FEATURE_commandlineparser 1
#define QT_FEATURE_settings -1
#define QT_FEATURE_textcodec 1 #define QT_FEATURE_textcodec 1
#endif #endif

View File

@ -41,7 +41,9 @@
#include "qdir.h" #include "qdir.h"
#include "qstringlist.h" #include "qstringlist.h"
#include "qfile.h" #include "qfile.h"
#if QT_CONFIG(settings)
#include "qsettings.h" #include "qsettings.h"
#endif
#include "qlibraryinfo.h" #include "qlibraryinfo.h"
#include "qscopedpointer.h" #include "qscopedpointer.h"
@ -67,7 +69,7 @@ QT_BEGIN_NAMESPACE
extern void qDumpCPUFeatures(); // in qsimd.cpp extern void qDumpCPUFeatures(); // in qsimd.cpp
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
struct QLibrarySettings struct QLibrarySettings
{ {
@ -204,7 +206,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
return 0; //no luck return 0; //no luck
} }
#endif // QT_NO_SETTINGS #endif // settings
/*! /*!
\class QLibraryInfo \class QLibraryInfo
@ -464,7 +466,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
#endif // QT_BUILD_QMAKE, started inside location ! #endif // QT_BUILD_QMAKE, started inside location !
QString ret; QString ret;
bool fromConf = false; bool fromConf = false;
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
#ifdef QT_BUILD_QMAKE #ifdef QT_BUILD_QMAKE
// Logic for choosing the right data source: if EffectivePaths are requested // Logic for choosing the right data source: if EffectivePaths are requested
// and qt.conf with that section is present, use it, otherwise fall back to // and qt.conf with that section is present, use it, otherwise fall back to
@ -547,7 +549,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
ret = QDir::fromNativeSeparators(ret); ret = QDir::fromNativeSeparators(ret);
} }
} }
#endif // QT_NO_SETTINGS #endif // settings
#ifndef QT_BUILD_QMAKE_BOOTSTRAP #ifndef QT_BUILD_QMAKE_BOOTSTRAP
if (!fromConf) { if (!fromConf) {
@ -646,7 +648,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)
{ {
#if !defined(QT_BUILD_QMAKE) && !defined(QT_NO_SETTINGS) #if !defined(QT_BUILD_QMAKE) && QT_CONFIG(settings)
QScopedPointer<const QSettings> settings(QLibraryInfoPrivate::findConfiguration()); QScopedPointer<const QSettings> settings(QLibraryInfoPrivate::findConfiguration());
if (!settings.isNull()) { if (!settings.isNull()) {
const QString key = QLatin1String(platformsSection) const QString key = QLatin1String(platformsSection)
@ -657,7 +659,7 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)
} }
#else #else
Q_UNUSED(platformName); Q_UNUSED(platformName);
#endif // !QT_BUILD_QMAKE && !QT_NO_SETTINGS #endif // !QT_BUILD_QMAKE && settings
return QStringList(); return QStringList();
} }

View File

@ -34,8 +34,6 @@ HEADERS += \
io/qurlquery.h \ io/qurlquery.h \
io/qurltlds_p.h \ io/qurltlds_p.h \
io/qtldurl_p.h \ io/qtldurl_p.h \
io/qsettings.h \
io/qsettings_p.h \
io/qfsfileengine_p.h \ io/qfsfileengine_p.h \
io/qfsfileengine_iterator_p.h \ io/qfsfileengine_iterator_p.h \
io/qfilesystementry_p.h \ io/qfilesystementry_p.h \
@ -73,7 +71,6 @@ SOURCES += \
io/qurlidna.cpp \ io/qurlidna.cpp \
io/qurlquery.cpp \ io/qurlquery.cpp \
io/qurlrecode.cpp \ io/qurlrecode.cpp \
io/qsettings.cpp \
io/qfsfileengine.cpp \ io/qfsfileengine.cpp \
io/qfsfileengine_iterator.cpp \ io/qfsfileengine_iterator.cpp \
io/qfilesystementry.cpp \ io/qfilesystementry.cpp \
@ -121,6 +118,24 @@ qtConfig(processenvironment) {
SOURCES += io/qprocess_unix.cpp SOURCES += io/qprocess_unix.cpp
} }
qtConfig(settings) {
SOURCES += \
io/qsettings.cpp
HEADERS += \
io/qsettings.h \
io/qsettings_p.h
win32 {
!winrt {
SOURCES += io/qsettings_win.cpp
} else {
SOURCES += io/qsettings_winrt.cpp
}
} else: darwin:!nacl {
SOURCES += io/qsettings_mac.cpp
}
}
win32 { win32 {
SOURCES += io/qfsfileengine_win.cpp SOURCES += io/qfsfileengine_win.cpp
SOURCES += io/qlockfile_win.cpp SOURCES += io/qlockfile_win.cpp
@ -136,7 +151,6 @@ win32 {
io/qwindowspipewriter_p.h io/qwindowspipewriter_p.h
SOURCES += \ SOURCES += \
io/qsettings_win.cpp \
io/qstandardpaths_win.cpp \ io/qstandardpaths_win.cpp \
io/qstorageinfo_win.cpp \ io/qstorageinfo_win.cpp \
io/qwindowspipereader.cpp \ io/qwindowspipereader.cpp \
@ -146,7 +160,6 @@ win32 {
} else { } else {
SOURCES += \ SOURCES += \
io/qstandardpaths_winrt.cpp \ io/qstandardpaths_winrt.cpp \
io/qsettings_winrt.cpp \
io/qstorageinfo_stub.cpp io/qstorageinfo_stub.cpp
} }
} else:unix { } else:unix {
@ -162,9 +175,6 @@ win32 {
../3rdparty/forkfd/forkfd.h ../3rdparty/forkfd/forkfd.h
INCLUDEPATH += ../3rdparty/forkfd INCLUDEPATH += ../3rdparty/forkfd
} }
!nacl:mac: {
SOURCES += io/qsettings_mac.cpp
}
mac { mac {
SOURCES += io/qstorageinfo_mac.cpp SOURCES += io/qstorageinfo_mac.cpp
qtConfig(processenvironment): \ qtConfig(processenvironment): \

View File

@ -41,8 +41,6 @@
#include "qplatformdefs.h" #include "qplatformdefs.h"
#include "qsettings.h" #include "qsettings.h"
#ifndef QT_NO_SETTINGS
#include "qsettings_p.h" #include "qsettings_p.h"
#include "qcache.h" #include "qcache.h"
#include "qfile.h" #include "qfile.h"
@ -3584,5 +3582,3 @@ QT_END_NAMESPACE
#ifndef QT_BOOTSTRAPPED #ifndef QT_BOOTSTRAPPED
#include "moc_qsettings.cpp" #include "moc_qsettings.cpp"
#endif #endif
#endif // QT_NO_SETTINGS

View File

@ -45,10 +45,7 @@
#include <QtCore/qstring.h> #include <QtCore/qstring.h>
#include <QtCore/qscopedpointer.h> #include <QtCore/qscopedpointer.h>
QT_BEGIN_NAMESPACE QT_REQUIRE_CONFIG(settings);
QT_END_NAMESPACE
#ifndef QT_NO_SETTINGS
#include <ctype.h> #include <ctype.h>
@ -208,6 +205,4 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_SETTINGS
#endif // QSETTINGS_H #endif // QSETTINGS_H

View File

@ -38,7 +38,6 @@
****************************************************************************/ ****************************************************************************/
#include "qsettings.h" #include "qsettings.h"
#ifndef QT_NO_SETTINGS
#include "qsettings_p.h" #include "qsettings_p.h"
#include "qdatetime.h" #include "qdatetime.h"
@ -664,4 +663,3 @@ bool QConfFileSettingsPrivate::writePlistFile(QIODevice &file, const ParsedSetti
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif //QT_NO_SETTINGS

View File

@ -39,8 +39,6 @@
#include "qsettings.h" #include "qsettings.h"
#ifndef QT_NO_SETTINGS
#include "qsettings_p.h" #include "qsettings_p.h"
#include "qvector.h" #include "qvector.h"
#include "qmap.h" #include "qmap.h"
@ -864,4 +862,3 @@ QSettingsPrivate *QSettingsPrivate::create(const QString &fileName, QSettings::F
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_SETTINGS

View File

@ -39,8 +39,6 @@
#include "qsettings.h" #include "qsettings.h"
#ifndef QT_NO_SETTINGS
#include "qsettings_p.h" #include "qsettings_p.h"
#include "qvector.h" #include "qvector.h"
#include "qmap.h" #include "qmap.h"
@ -690,4 +688,3 @@ QSettingsPrivate *QSettingsPrivate::create(const QString &fileName, QSettings::F
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_SETTINGS

View File

@ -53,7 +53,9 @@
#include "QtCore/qcoreapplication.h" #include "QtCore/qcoreapplication.h"
#include "QtCore/qtranslator.h" #include "QtCore/qtranslator.h"
#if QT_CONFIG(settings)
#include "QtCore/qsettings.h" #include "QtCore/qsettings.h"
#endif
#ifndef QT_NO_QOBJECT #ifndef QT_NO_QOBJECT
#include "private/qobject_p.h" #include "private/qobject_p.h"
#endif #endif

View File

@ -50,7 +50,9 @@
#include <QtCore/qmath.h> #include <QtCore/qmath.h>
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QDir> #include <QtCore/QDir>
#if QT_CONFIG(settings)
#include <QtCore/QSettings> #include <QtCore/QSettings>
#endif
#include <QtGui/QPainter> #include <QtGui/QPainter>
#include <private/qhexstring_p.h> #include <private/qhexstring_p.h>
@ -348,7 +350,7 @@ QIconTheme::QIconTheme(const QString &themeName)
m_valid = true; m_valid = true;
} }
} }
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
if (themeIndex.exists()) { if (themeIndex.exists()) {
const QSettings indexReader(themeIndex.fileName(), QSettings::IniFormat); const QSettings indexReader(themeIndex.fileName(), QSettings::IniFormat);
const QStringList keys = indexReader.allKeys(); const QStringList keys = indexReader.allKeys();
@ -407,7 +409,7 @@ QIconTheme::QIconTheme(const QString &themeName)
if (!m_parents.contains(QLatin1String("hicolor"))) if (!m_parents.contains(QLatin1String("hicolor")))
m_parents.append(QLatin1String("hicolor")); m_parents.append(QLatin1String("hicolor"));
} }
#endif //QT_NO_SETTINGS #endif // settings
} }
QThemeIconInfo QIconLoader::findIconHelper(const QString &themeName, QThemeIconInfo QIconLoader::findIconHelper(const QString &themeName,

View File

@ -42,7 +42,9 @@
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtCore/QVariant> #include <QtCore/QVariant>
#include <QtCore/QSharedData> #include <QtCore/QSharedData>
#if QT_CONFIG(settings)
#include <QtCore/QSettings> #include <QtCore/QSettings>
#endif
#include <QtCore/QUrl> #include <QtCore/QUrl>
#include <QtCore/QVector> #include <QtCore/QVector>
#include <QtGui/QColor> #include <QtGui/QColor>
@ -284,7 +286,7 @@ QColorDialogStaticData::QColorDialogStaticData() : customSet(false)
void QColorDialogStaticData::readSettings() void QColorDialogStaticData::readSettings()
{ {
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
const QSettings settings(QSettings::UserScope, QStringLiteral("QtProject")); const QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));
for (int i = 0; i < int(CustomColorCount); ++i) { for (int i = 0; i < int(CustomColorCount); ++i) {
const QVariant v = settings.value(QLatin1String("Qt/customColors/") + QString::number(i)); const QVariant v = settings.value(QLatin1String("Qt/customColors/") + QString::number(i));
@ -296,7 +298,7 @@ void QColorDialogStaticData::readSettings()
void QColorDialogStaticData::writeSettings() const void QColorDialogStaticData::writeSettings() const
{ {
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
if (customSet) { if (customSet) {
const_cast<QColorDialogStaticData*>(this)->customSet = false; const_cast<QColorDialogStaticData*>(this)->customSet = false;
QSettings settings(QSettings::UserScope, QStringLiteral("QtProject")); QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));

View File

@ -48,14 +48,14 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformInputContextFactoryInterface_iid, QLatin1String("/platforminputcontexts"), Qt::CaseInsensitive)) (QPlatformInputContextFactoryInterface_iid, QLatin1String("/platforminputcontexts"), Qt::CaseInsensitive))
#endif #endif
QStringList QPlatformInputContextFactory::keys() QStringList QPlatformInputContextFactory::keys()
{ {
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
return loader()->keyMap().values(); return loader()->keyMap().values();
#else #else
return QStringList(); return QStringList();
@ -70,7 +70,7 @@ QString QPlatformInputContextFactory::requested()
QPlatformInputContext *QPlatformInputContextFactory::create(const QString& key) QPlatformInputContext *QPlatformInputContextFactory::create(const QString& key)
{ {
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
if (!key.isEmpty()) { if (!key.isEmpty()) {
QStringList paramList = key.split(QLatin1Char(':')); QStringList paramList = key.split(QLatin1Char(':'));
const QString platform = paramList.takeFirst().toLower(); const QString platform = paramList.takeFirst().toLower();

View File

@ -424,7 +424,7 @@
Note that by combining this option with ReuseAddressHint, you will Note that by combining this option with ReuseAddressHint, you will
also allow your service to rebind an existing shared address. On also allow your service to rebind an existing shared address. On
Unix, this is equivalent to the SO_REUSEADDR socket option. On Windows, Unix, this is equivalent to the SO_REUSEADDR socket option. On Windows,
this option is ignored. this is the default behavior, so this option is ignored.
\value DontShareAddress Bind the address and port exclusively, so that \value DontShareAddress Bind the address and port exclusively, so that
no other services are allowed to rebind. By passing this option to no other services are allowed to rebind. By passing this option to
@ -444,7 +444,7 @@
\value DefaultForPlatform The default option for the current platform. \value DefaultForPlatform The default option for the current platform.
On Unix and \macos, this is equivalent to (DontShareAddress On Unix and \macos, this is equivalent to (DontShareAddress
+ ReuseAddressHint), and on Windows, its equivalent to ShareAddress. + ReuseAddressHint), and on Windows, it is equivalent to ShareAddress.
*/ */
/*! \enum QAbstractSocket::PauseMode /*! \enum QAbstractSocket::PauseMode
@ -455,7 +455,7 @@
The only notification currently supported is QSslSocket::sslErrors(). The only notification currently supported is QSslSocket::sslErrors().
\value PauseNever Do not pause data transfer on the socket. This is the \value PauseNever Do not pause data transfer on the socket. This is the
default and matches the behaviour of Qt 4. default and matches the behavior of Qt 4.
\value PauseOnSslErrors Pause data transfer on the socket upon receiving an \value PauseOnSslErrors Pause data transfer on the socket upon receiving an
SSL error notification. I.E. QSslSocket::sslErrors(). SSL error notification. I.E. QSslSocket::sslErrors().
*/ */
@ -1538,11 +1538,9 @@ void QAbstractSocket::setPauseMode(PauseModes pauseMode)
Binds to \a address on port \a port, using the BindMode \a mode. Binds to \a address on port \a port, using the BindMode \a mode.
Binds this socket to the address \a address and the port \a port.
For UDP sockets, after binding, the signal QUdpSocket::readyRead() is emitted For UDP sockets, after binding, the signal QUdpSocket::readyRead() is emitted
whenever a UDP datagram arrives on the specified address and port. whenever a UDP datagram arrives on the specified address and port.
Thus, This function is useful to write UDP servers. Thus, this function is useful to write UDP servers.
For TCP sockets, this function may be used to specify which interface to use For TCP sockets, this function may be used to specify which interface to use
for an outgoing connection, which is useful in case of multiple network for an outgoing connection, which is useful in case of multiple network

View File

@ -5205,25 +5205,6 @@ void QGLWidgetPrivate::cleanupColormaps()
{ {
} }
Q_GLOBAL_STATIC(QString, qt_gl_lib_name)
void qt_set_gl_library_name(const QString& name)
{
qt_gl_lib_name()->operator=(name);
}
const QString qt_gl_library_name()
{
if (qt_gl_lib_name()->isNull()) {
# if defined(QT_OPENGL_ES_2)
return QLatin1String("GLESv2");
# else
return QLatin1String("GL");
# endif
}
return *qt_gl_lib_name();
}
void QGLContextGroup::addShare(const QGLContext *context, const QGLContext *share) { void QGLContextGroup::addShare(const QGLContext *context, const QGLContext *share) {
Q_ASSERT(context && share); Q_ASSERT(context && share);
if (context->d_ptr->group == share->d_ptr->group) if (context->d_ptr->group == share->d_ptr->group)

View File

@ -50,7 +50,9 @@
#include "qcoretextfontdatabase_p.h" #include "qcoretextfontdatabase_p.h"
#include "qfontengine_coretext_p.h" #include "qfontengine_coretext_p.h"
#if QT_CONFIG(settings)
#include <QtCore/QSettings> #include <QtCore/QSettings>
#endif
#include <QtCore/QtEndian> #include <QtCore/QtEndian>
#ifndef QT_NO_FREETYPE #ifndef QT_NO_FREETYPE
#include <QtFontDatabaseSupport/private/qfontengine_ft_p.h> #include <QtFontDatabaseSupport/private/qfontengine_ft_p.h>
@ -116,21 +118,25 @@ QCoreTextFontDatabase::QCoreTextFontDatabase()
: m_hasPopulatedAliases(false) : m_hasPopulatedAliases(false)
{ {
#ifdef Q_OS_MACX #ifdef Q_OS_MACX
QSettings appleSettings(QLatin1String("apple.com"));
QVariant appleValue = appleSettings.value(QLatin1String("AppleAntiAliasingThreshold"));
if (appleValue.isValid())
QCoreTextFontEngine::antialiasingThreshold = appleValue.toInt();
/* /*
font_smoothing = 0 means no smoothing, while 1-3 means subpixel font_smoothing = 0 means no smoothing, while 1-3 means subpixel
antialiasing with different hinting styles (but we don't care about the antialiasing with different hinting styles (but we don't care about the
exact value, only if subpixel rendering is available or not) exact value, only if subpixel rendering is available or not)
*/ */
int font_smoothing = 0; int font_smoothing = 0;
#if QT_CONFIG(settings)
QSettings appleSettings(QLatin1String("apple.com"));
QVariant appleValue = appleSettings.value(QLatin1String("AppleAntiAliasingThreshold"));
if (appleValue.isValid())
QCoreTextFontEngine::antialiasingThreshold = appleValue.toInt();
appleValue = appleSettings.value(QLatin1String("AppleFontSmoothing")); appleValue = appleSettings.value(QLatin1String("AppleFontSmoothing"));
if (appleValue.isValid()) { if (appleValue.isValid()) {
font_smoothing = appleValue.toInt(); font_smoothing = appleValue.toInt();
} else { } else
#endif // settings
{
// non-Apple displays do not provide enough information about subpixel rendering so // non-Apple displays do not provide enough information about subpixel rendering so
// draw text with cocoa and compare pixel colors to see if subpixel rendering is enabled // draw text with cocoa and compare pixel colors to see if subpixel rendering is enabled
int w = 10; int w = 10;

View File

@ -41,7 +41,9 @@
#include <qpa/qplatformfontdatabase.h> #include <qpa/qplatformfontdatabase.h>
#include <QtCore/qendian.h> #include <QtCore/qendian.h>
#if QT_CONFIG(settings)
#include <QtCore/qsettings.h> #include <QtCore/qsettings.h>
#endif
#include <QtCore/qoperatingsystemversion.h> #include <QtCore/qoperatingsystemversion.h>
#include <private/qimage_p.h> #include <private/qimage_p.h>

View File

@ -45,7 +45,9 @@
#if QT_CONFIG(process) #if QT_CONFIG(process)
# include <QtCore/QProcess> # include <QtCore/QProcess>
#endif #endif
#if QT_CONFIG(settings)
#include <QtCore/QSettings> #include <QtCore/QSettings>
#endif
#include <QtCore/QStandardPaths> #include <QtCore/QStandardPaths>
#include <QtCore/QUrl> #include <QtCore/QUrl>
@ -93,7 +95,7 @@ static inline QByteArray detectDesktopEnvironment()
// This can be a path in /usr/share/xsessions // This can be a path in /usr/share/xsessions
int slash = desktopSession.lastIndexOf('/'); int slash = desktopSession.lastIndexOf('/');
if (slash != -1) { if (slash != -1) {
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
QSettings desktopFile(QFile::decodeName(desktopSession + ".desktop"), QSettings::IniFormat); QSettings desktopFile(QFile::decodeName(desktopSession + ".desktop"), QSettings::IniFormat);
desktopFile.beginGroup(QStringLiteral("Desktop Entry")); desktopFile.beginGroup(QStringLiteral("Desktop Entry"));
QByteArray desktopName = desktopFile.value(QStringLiteral("DesktopNames")).toByteArray(); QByteArray desktopName = desktopFile.value(QStringLiteral("DesktopNames")).toByteArray();

View File

@ -53,7 +53,9 @@
#include <QtCore/QMimeDatabase> #include <QtCore/QMimeDatabase>
#endif #endif
#include <QtCore/QLoggingCategory> #include <QtCore/QLoggingCategory>
#if QT_CONFIG(settings)
#include <QtCore/QSettings> #include <QtCore/QSettings>
#endif
#include <QtCore/QVariant> #include <QtCore/QVariant>
#include <QtCore/QStandardPaths> #include <QtCore/QStandardPaths>
#include <QtCore/QStringList> #include <QtCore/QStringList>
@ -261,7 +263,7 @@ static QIcon xdgFileIcon(const QFileInfo &fileInfo)
} }
#endif #endif
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
class QKdeThemePrivate : public QPlatformThemePrivate class QKdeThemePrivate : public QPlatformThemePrivate
{ {
public: public:
@ -688,7 +690,7 @@ QPlatformSystemTrayIcon *QKdeTheme::createPlatformSystemTrayIcon() const
} }
#endif #endif
#endif // QT_NO_SETTINGS #endif // settings
/*! /*!
\class QGnomeTheme \class QGnomeTheme
@ -834,7 +836,7 @@ QPlatformTheme *QGenericUnixTheme::createUnixTheme(const QString &name)
{ {
if (name == QLatin1String(QGenericUnixTheme::name)) if (name == QLatin1String(QGenericUnixTheme::name))
return new QGenericUnixTheme; return new QGenericUnixTheme;
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
if (name == QLatin1String(QKdeTheme::name)) if (name == QLatin1String(QKdeTheme::name))
if (QPlatformTheme *kdeTheme = QKdeTheme::createKdeTheme()) if (QPlatformTheme *kdeTheme = QKdeTheme::createKdeTheme())
return kdeTheme; return kdeTheme;
@ -859,7 +861,7 @@ QStringList QGenericUnixTheme::themeNames()
const QList<QByteArray> desktopNames = desktopEnvironment.split(':'); const QList<QByteArray> desktopNames = desktopEnvironment.split(':');
for (const QByteArray &desktopName : desktopNames) { for (const QByteArray &desktopName : desktopNames) {
if (desktopEnvironment == "KDE") { if (desktopEnvironment == "KDE") {
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
result.push_back(QLatin1String(QKdeTheme::name)); result.push_back(QLatin1String(QKdeTheme::name));
#endif #endif
} else if (gtkBasedEnvironments.contains(desktopName)) { } else if (gtkBasedEnvironments.contains(desktopName)) {

View File

@ -96,7 +96,7 @@ public:
static const char *name; static const char *name;
}; };
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
class QKdeThemePrivate; class QKdeThemePrivate;
class QKdeTheme : public QPlatformTheme class QKdeTheme : public QPlatformTheme
@ -123,7 +123,7 @@ public:
static const char *name; static const char *name;
}; };
#endif // QT_NO_SETTINGS #endif // settings
class QGnomeThemePrivate; class QGnomeThemePrivate;

View File

@ -649,8 +649,6 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName)
#endif #endif
{ {
#if QT_CONFIG(library) #if QT_CONFIG(library)
extern const QString qt_gl_library_name();
// QLibrary lib(qt_gl_library_name());
QLibrary lib(QLatin1String("GL")); QLibrary lib(QLatin1String("GL"));
if (!lib.load()) if (!lib.load())
lib.setFileNameAndVersion(QLatin1String("GL"), 1); lib.setFileNameAndVersion(QLatin1String("GL"), 1);

View File

@ -150,7 +150,7 @@ do {\
// Ideally we'd use qWaitFor instead of QTRY_LOOP_IMPL, but due // Ideally we'd use qWaitFor instead of QTRY_LOOP_IMPL, but due
// to a compiler bug on MSVC < 2017 we can't (see QTBUG-59096) // to a compiler bug on MSVC < 2017 we can't (see QTBUG-59096)
#define QTRY_IMPL(expr, timeout)\ #define QTRY_IMPL(expr, timeout)\
const int qt_test_step = 50; \ const int qt_test_step = timeout < 350 ? timeout / 7 + 1 : 50; \
const int qt_test_timeoutValue = timeout; \ const int qt_test_timeoutValue = timeout; \
QTRY_LOOP_IMPL((expr), qt_test_timeoutValue, qt_test_step); \ QTRY_LOOP_IMPL((expr), qt_test_timeoutValue, qt_test_step); \
QTRY_TIMEOUT_DEBUG_IMPL((expr), qt_test_timeoutValue, qt_test_step)\ QTRY_TIMEOUT_DEBUG_IMPL((expr), qt_test_timeoutValue, qt_test_step)\

View File

@ -57,7 +57,9 @@
#include "qpainter.h" #include "qpainter.h"
#include "qpixmap.h" #include "qpixmap.h"
#include "qpushbutton.h" #include "qpushbutton.h"
#if QT_CONFIG(settings)
#include "qsettings.h" #include "qsettings.h"
#endif
#include "qsharedpointer.h" #include "qsharedpointer.h"
#include "qstyle.h" #include "qstyle.h"
#include "qstyleoption.h" #include "qstyleoption.h"

View File

@ -57,7 +57,9 @@
#include <qmessagebox.h> #include <qmessagebox.h>
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#if QT_CONFIG(settings)
#include <qsettings.h> #include <qsettings.h>
#endif
#include <qdebug.h> #include <qdebug.h>
#if QT_CONFIG(mimetype) #if QT_CONFIG(mimetype)
#include <qmimedatabase.h> #include <qmimedatabase.h>
@ -386,7 +388,7 @@ QFileDialog::QFileDialog(const QFileDialogArgs &args)
*/ */
QFileDialog::~QFileDialog() QFileDialog::~QFileDialog()
{ {
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
Q_D(QFileDialog); Q_D(QFileDialog);
d->saveSettings(); d->saveSettings();
#endif #endif
@ -2739,7 +2741,7 @@ void QFileDialog::accept()
} }
} }
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
void QFileDialogPrivate::saveSettings() void QFileDialogPrivate::saveSettings()
{ {
Q_Q(QFileDialog); Q_Q(QFileDialog);
@ -2797,7 +2799,7 @@ bool QFileDialogPrivate::restoreFromSettings()
return restoreWidgetState(history, settings.value(QLatin1String("sidebarWidth"), -1).toInt()); return restoreWidgetState(history, settings.value(QLatin1String("sidebarWidth"), -1).toInt());
} }
#endif // QT_NO_SETTINGS #endif // settings
bool QFileDialogPrivate::restoreWidgetState(QStringList &history, int splitterPosition) bool QFileDialogPrivate::restoreWidgetState(QStringList &history, int splitterPosition)
{ {
@ -2870,7 +2872,7 @@ void QFileDialogPrivate::init(const QUrl &directory, const QString &nameFilter,
else else
q->selectUrl(directory); q->selectUrl(directory);
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
// Try to restore from the FileDialog settings group; if it fails, fall back // Try to restore from the FileDialog settings group; if it fails, fall back
// to the pre-5.5 QByteArray serialized settings. // to the pre-5.5 QByteArray serialized settings.
if (!restoreFromSettings()) { if (!restoreFromSettings()) {
@ -3035,7 +3037,7 @@ void QFileDialogPrivate::createWidgets()
createToolButtons(); createToolButtons();
createMenuActions(); createMenuActions();
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
// Try to restore from the FileDialog settings group; if it fails, fall back // Try to restore from the FileDialog settings group; if it fails, fall back
// to the pre-5.5 QByteArray serialized settings. // to the pre-5.5 QByteArray serialized settings.
if (!restoreFromSettings()) { if (!restoreFromSettings()) {

View File

@ -187,7 +187,7 @@ public:
#endif #endif
} }
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
void saveSettings(); void saveSettings();
bool restoreFromSettings(); bool restoreFromSettings();
#endif #endif

View File

@ -113,7 +113,7 @@ public:
bool tryCloseAllWindows() override; bool tryCloseAllWindows() override;
#if 0 // Used to be included in Qt4 for Q_WS_X11 #if 0 // Used to be included in Qt4 for Q_WS_X11
#ifndef QT_NO_SETTINGS #if QT_CONFIG(settings)
static bool x11_apply_settings(); static bool x11_apply_settings();
#endif #endif
static void reset_instance_pointer(); static void reset_instance_pointer();

View File

@ -102,7 +102,9 @@
#endif #endif
#include <qfileinfo.h> #include <qfileinfo.h>
#include <qdir.h> #include <qdir.h>
#if QT_CONFIG(settings)
#include <qsettings.h> #include <qsettings.h>
#endif
#include <qvariant.h> #include <qvariant.h>
#include <qpixmapcache.h> #include <qpixmapcache.h>
#if QT_CONFIG(animation) #if QT_CONFIG(animation)

View File

@ -65,6 +65,9 @@ win32:!qtConfig(private_tests): SUBDIRS -= \
qprocess \ qprocess \
qprocess-noapplication qprocess-noapplication
!qtConfig(settings): SUBDIRS -= \
qsettings
winrt: SUBDIRS -= \ winrt: SUBDIRS -= \
qstorageinfo qstorageinfo