diff options
author | Liang Qi <liang.qi@qt.io> | 2018-11-21 23:59:03 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-22 01:53:29 +0100 |
commit | bf58c70546c5f9cb66d99b82abfde9ba1a056192 (patch) | |
tree | df3675d3377ef6576f82fb167ebd67fcc900a91b /src/corelib/io | |
parent | 37f617c405ae4f26cbb6bb4f08d61d6ccc111a98 (diff) | |
parent | 41cba737a98b16a2767c55cda0532f38b6b6a37d (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
src/corelib/io/qdir.cpp
src/corelib/kernel/qtimer.cpp
src/corelib/kernel/qtimer.h
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/io.pri | 26 | ||||
-rw-r--r-- | src/corelib/io/qdir.cpp | 11 | ||||
-rw-r--r-- | src/corelib/io/qprocess.cpp | 8 | ||||
-rw-r--r-- | src/corelib/io/qresource.cpp | 18 | ||||
-rw-r--r-- | src/corelib/io/qsettings.cpp | 4 | ||||
-rw-r--r-- | src/corelib/io/qsettings.h | 7 | ||||
-rw-r--r-- | src/corelib/io/qsettings_mac.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qsettings_win.cpp | 3 | ||||
-rw-r--r-- | src/corelib/io/qsettings_winrt.cpp | 3 |
9 files changed, 43 insertions, 39 deletions
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index c6a5407e51..086d642c26 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -34,8 +34,6 @@ HEADERS += \ io/qurlquery.h \ io/qurltlds_p.h \ io/qtldurl_p.h \ - io/qsettings.h \ - io/qsettings_p.h \ io/qfsfileengine_p.h \ io/qfsfileengine_iterator_p.h \ io/qfilesystementry_p.h \ @@ -73,7 +71,6 @@ SOURCES += \ io/qurlidna.cpp \ io/qurlquery.cpp \ io/qurlrecode.cpp \ - io/qsettings.cpp \ io/qfsfileengine.cpp \ io/qfsfileengine_iterator.cpp \ io/qfilesystementry.cpp \ @@ -121,6 +118,24 @@ qtConfig(processenvironment) { 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 { SOURCES += io/qfsfileengine_win.cpp SOURCES += io/qlockfile_win.cpp @@ -136,7 +151,6 @@ win32 { io/qwindowspipewriter_p.h SOURCES += \ - io/qsettings_win.cpp \ io/qstandardpaths_win.cpp \ io/qstorageinfo_win.cpp \ io/qwindowspipereader.cpp \ @@ -146,7 +160,6 @@ win32 { } else { SOURCES += \ io/qstandardpaths_winrt.cpp \ - io/qsettings_winrt.cpp \ io/qstorageinfo_stub.cpp } } else:unix { @@ -162,9 +175,6 @@ win32 { ../3rdparty/forkfd/forkfd.h INCLUDEPATH += ../3rdparty/forkfd } - !nacl:mac: { - SOURCES += io/qsettings_mac.cpp - } mac { SOURCES += io/qstorageinfo_mac.cpp qtConfig(processenvironment): \ diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 0998d7ffd1..7df461ddce 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1040,7 +1040,8 @@ QStringList QDir::nameFilters() const list of filters specified by \a nameFilters. Each name filter is a wildcard (globbing) filter that understands - \c{*} and \c{?} wildcards. (See \l{Wildcard matching}.) + \c{*} and \c{?} wildcards. See \l{QRegularExpression#Wildcard matching} + {QRegularExpression Wildcard Matching}. For example, the following code sets three name filters on a QDir to ensure that only files with extensions typically used for C++ @@ -2120,8 +2121,8 @@ QString QDir::rootPath() patterns in the list of \a filters; otherwise returns \c false. The matching is case insensitive. - \sa {Wildcard matching}, QRegularExpression::wildcardToRegularExpression(), - entryList(), entryInfoList() + \sa {QRegularExpression#Wildcard matching}{QRegularExpression Wildcard Matching}, + entryList(), entryInfoList() */ bool QDir::match(const QStringList &filters, const QString &fileName) { @@ -2143,8 +2144,8 @@ bool QDir::match(const QStringList &filters, const QString &fileName) contain multiple patterns separated by spaces or semicolons. The matching is case insensitive. - \sa {Wildcard matching}, QRegularExpression::wildcardToRegularExpression, - entryList(), entryInfoList() + \sa {QRegularExpression#Wildcard matching}{QRegularExpression Wildcard Matching}, + entryList(), entryInfoList() */ bool QDir::match(const QString &filter, const QString &fileName) { diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 890867cd51..e1f4a3a311 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -112,12 +112,12 @@ QT_BEGIN_NAMESPACE \relates QProcess Disables the - \l {QProcess::start(const QString &, OpenMode)}{QProcess::start()} - overload taking a single string. + \l {QProcess::start(const QString &, QIODevice::OpenMode)} + {QProcess::start}() overload taking a single string. In most cases where it is used, the user intends for the first argument to be treated atomically as per the other overload. - \sa QProcess::start(const QString &command, OpenMode mode) + \sa QProcess::start(const QString &command, QIODevice::OpenMode mode) */ /*! @@ -2557,7 +2557,7 @@ bool QProcess::startDetached(const QString &program, After the \a command string has been split and unquoted, this function behaves like the overload which takes the arguments as a string list. - \sa start(const QString &command, OpenMode mode) + \sa start(const QString &command, QIODevice::OpenMode mode) */ bool QProcess::startDetached(const QString &command) { diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index 8a0d2e0200..9cfaa4d623 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -1288,7 +1288,6 @@ bool QResourceFileEngine::close() { Q_D(QResourceFileEngine); d->offset = 0; - d->uncompressed.clear(); return true; } @@ -1503,14 +1502,25 @@ uchar *QResourceFileEnginePrivate::map(qint64 offset, qint64 size, QFile::Memory { Q_Q(QResourceFileEngine); Q_UNUSED(flags); + + qint64 max = resource.size(); + if (resource.isCompressed()) { + uncompress(); + max = uncompressed.size(); + } + qint64 end; if (offset < 0 || size <= 0 || !resource.isValid() || - add_overflow(offset, size, &end) || end > resource.size()) { + add_overflow(offset, size, &end) || end > max) { q->setError(QFile::UnspecifiedError, QString()); return 0; } - uchar *address = const_cast<uchar *>(resource.data()); - return (address + offset); + + const uchar *address = resource.data(); + if (resource.isCompressed()) + address = reinterpret_cast<const uchar *>(uncompressed.constData()); + + return const_cast<uchar *>(address) + offset; } bool QResourceFileEnginePrivate::unmap(uchar *ptr) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 3886b16dcf..74ec1801d0 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -41,8 +41,6 @@ #include "qplatformdefs.h" #include "qsettings.h" -#ifndef QT_NO_SETTINGS - #include "qsettings_p.h" #include "qcache.h" #include "qfile.h" @@ -3617,5 +3615,3 @@ QT_END_NAMESPACE #ifndef QT_BOOTSTRAPPED #include "moc_qsettings.cpp" #endif - -#endif // QT_NO_SETTINGS diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h index 947507b642..32290a3390 100644 --- a/src/corelib/io/qsettings.h +++ b/src/corelib/io/qsettings.h @@ -45,10 +45,7 @@ #include <QtCore/qstring.h> #include <QtCore/qscopedpointer.h> -QT_BEGIN_NAMESPACE -QT_END_NAMESPACE - -#ifndef QT_NO_SETTINGS +QT_REQUIRE_CONFIG(settings); #include <ctype.h> @@ -212,6 +209,4 @@ private: QT_END_NAMESPACE -#endif // QT_NO_SETTINGS - #endif // QSETTINGS_H diff --git a/src/corelib/io/qsettings_mac.cpp b/src/corelib/io/qsettings_mac.cpp index 28f01eae4d..443e6bb00a 100644 --- a/src/corelib/io/qsettings_mac.cpp +++ b/src/corelib/io/qsettings_mac.cpp @@ -38,7 +38,6 @@ ****************************************************************************/ #include "qsettings.h" -#ifndef QT_NO_SETTINGS #include "qsettings_p.h" #include "qdatetime.h" @@ -664,4 +663,3 @@ bool QConfFileSettingsPrivate::writePlistFile(QIODevice &file, const ParsedSetti } QT_END_NAMESPACE -#endif //QT_NO_SETTINGS diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp index 1881d0dc7e..dd3468e1f8 100644 --- a/src/corelib/io/qsettings_win.cpp +++ b/src/corelib/io/qsettings_win.cpp @@ -39,8 +39,6 @@ #include "qsettings.h" -#ifndef QT_NO_SETTINGS - #include "qsettings_p.h" #include "qvector.h" #include "qmap.h" @@ -864,4 +862,3 @@ QSettingsPrivate *QSettingsPrivate::create(const QString &fileName, QSettings::F } QT_END_NAMESPACE -#endif // QT_NO_SETTINGS diff --git a/src/corelib/io/qsettings_winrt.cpp b/src/corelib/io/qsettings_winrt.cpp index 4c757f9dda..e91d4d64a2 100644 --- a/src/corelib/io/qsettings_winrt.cpp +++ b/src/corelib/io/qsettings_winrt.cpp @@ -39,8 +39,6 @@ #include "qsettings.h" -#ifndef QT_NO_SETTINGS - #include "qsettings_p.h" #include "qvector.h" #include "qmap.h" @@ -690,4 +688,3 @@ QSettingsPrivate *QSettingsPrivate::create(const QString &fileName, QSettings::F } QT_END_NAMESPACE -#endif // QT_NO_SETTINGS |