diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-20 19:12:23 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-20 19:12:25 +0200 |
commit | 3361fcbc28be96262d22fd2b024c85fbcbc61462 (patch) | |
tree | 48976f337b3885971dc1976b9a27cec5e7dfa2ec /src/corelib/io | |
parent | dc612acdc6577594c8f61345cea2de549d7aae34 (diff) | |
parent | 5e342f6f041208d142d97202f61179d7163eb773 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: If7e51514ed6832750e3ad967e4d322ccf920d2bb
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qfiledevice.cpp | 4 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemmetadata_p.h | 3 | ||||
-rw-r--r-- | src/corelib/io/qfsfileengine_p.h | 2 | ||||
-rw-r--r-- | src/corelib/io/qloggingregistry.cpp | 8 | ||||
-rw-r--r-- | src/corelib/io/qprocess.cpp | 7 | ||||
-rw-r--r-- | src/corelib/io/qprocess_win.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qsettings.cpp | 19 |
7 files changed, 36 insertions, 9 deletions
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp index 8691a44d8d..8d1c59e159 100644 --- a/src/corelib/io/qfiledevice.cpp +++ b/src/corelib/io/qfiledevice.cpp @@ -608,9 +608,9 @@ qint64 QFileDevice::size() const } /*! - Sets the file size (in bytes) \a sz. Returns \c true if the file if the + Sets the file size (in bytes) \a sz. Returns \c true if the resize succeeds; false otherwise. If \a sz is larger than the file - currently is the new bytes will be set to 0, if \a sz is smaller the + currently is, the new bytes will be set to 0; if \a sz is smaller, the file is simply truncated. \sa size() diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h index cf1218cb41..147acda3d6 100644 --- a/src/corelib/io/qfilesystemmetadata_p.h +++ b/src/corelib/io/qfilesystemmetadata_p.h @@ -66,7 +66,8 @@ class QFileSystemMetaData { public: QFileSystemMetaData() - : knownFlagsMask(0) + : knownFlagsMask(0), + size_(-1) { } diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h index 5d5a29243e..3963a9cb11 100644 --- a/src/corelib/io/qfsfileengine_p.h +++ b/src/corelib/io/qfsfileengine_p.h @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE class QFSFileEnginePrivate; -class Q_AUTOTEST_EXPORT QFSFileEngine : public QAbstractFileEngine +class Q_CORE_EXPORT QFSFileEngine : public QAbstractFileEngine { Q_DECLARE_PRIVATE(QFSFileEngine) public: diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp index e9ee8d9458..8af1487834 100644 --- a/src/corelib/io/qloggingregistry.cpp +++ b/src/corelib/io/qloggingregistry.cpp @@ -398,9 +398,11 @@ void QLoggingRegistry::defaultCategoryFilter(QLoggingCategory *cat) // hard-wired implementation of // qt.*.debug=false // qt.debug=false - char c; - if (!memcmp(cat->categoryName(), "qt", 2) && (!(c = cat->categoryName()[2]) || c == '.')) - debug = false; + if (const char *categoryName = cat->categoryName()) { + // == "qt" or startsWith("qt.") + if (strcmp(categoryName, "qt") == 0 || strncmp(categoryName, "qt.", 3) == 0) + debug = false; + } QString categoryName = QLatin1String(cat->categoryName()); foreach (const QLoggingRule &item, reg->rules) { diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index e009191be9..e76a836954 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -538,6 +538,13 @@ void QProcessPrivate::Channel::clear() setWorkingDirectory(). By default, processes are run in the current working directory of the calling process. + The positioning and the screen Z-order of windows belonging to + GUI applications started with QProcess are controlled by + the underlying windowing system. For Qt 5 applications, the + positioning can be specified using the \c{-qwindowgeometry} + command line option; X11 applications generally accept a + \c{-geometry} command line option. + \note On QNX, setting the working directory may cause all application threads, with the exception of the QProcess caller thread, to temporarily freeze during the spawning process, diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 980fb58865..ee6b7e13f4 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -634,7 +634,7 @@ bool QProcessPrivate::drainOutputPipes() someReadyReadEmitted |= readyReadEmitted; if (!readOperationActive || !readyReadEmitted) break; - Sleep(100); + QThread::yieldCurrentThread(); } return someReadyReadEmitted; diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index f6cd5aa7c9..d896da176a 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -100,6 +100,10 @@ using namespace ABI::Windows::Storage; #define CSIDL_APPDATA 0x001a // <username>\Application Data #endif +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_BLACKBERRY) && !defined(Q_OS_ANDROID) +#define Q_XDG_PLATFORM +#endif + // ************************************************************************ // QConfFile @@ -1041,7 +1045,9 @@ static void initDefaultPaths(QMutexLocker *locker) windowsConfigPath(CSIDL_COMMON_APPDATA) + QDir::separator()); #else -#ifdef QT_NO_STANDARDPATHS +#if defined(QT_NO_STANDARDPATHS) || !defined(Q_XDG_PLATFORM) + // Non XDG platforms (OS X, iOS, Blackberry, Android...) have used this code path erroneously + // for some time now. Moving away from that would require migrating existing settings. QString userPath; char *env = getenv("XDG_CONFIG_HOME"); if (env == 0) { @@ -1056,6 +1062,9 @@ static void initDefaultPaths(QMutexLocker *locker) userPath += QFile::decodeName(env); } #else + // When using a proper XDG platform, use QStandardPaths rather than the above hand-written code; + // it makes the use of test mode from unit tests possible. + // Ideally all platforms should use this, but see above for the migration issue. QString userPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); #endif userPath += QLatin1Char('/'); @@ -3112,6 +3121,10 @@ bool QSettings::isWritable() const void QSettings::setValue(const QString &key, const QVariant &value) { Q_D(QSettings); + if (key.isEmpty()) { + qWarning("QSettings::setValue: Empty key passed"); + return; + } QString k = d->actualKey(key); d->set(k, value); d->requestUpdate(); @@ -3244,6 +3257,10 @@ bool QSettings::event(QEvent *event) QVariant QSettings::value(const QString &key, const QVariant &defaultValue) const { Q_D(const QSettings); + if (key.isEmpty()) { + qWarning("QSettings::value: Empty key passed"); + return QVariant(); + } QVariant result = defaultValue; QString k = d->actualKey(key); d->get(k, &result); |