summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-10-09 15:50:11 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-09 15:50:11 +0200
commitda0cb32b8ee7cc4a991a59420a411898e63a660e (patch)
tree9ed8e190a6543518f9b082afc5a380f659da0220 /src/corelib/io
parent7f3e3c1099f42cff46bbd267c70587bcf72024fc (diff)
parentd8fc0da235b2bd566b2b6f1e21218afdf2f34eb3 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qdir.cpp8
-rw-r--r--src/corelib/io/qfileinfo.cpp8
-rw-r--r--src/corelib/io/qfilesystemwatcher_win_p.h4
-rw-r--r--src/corelib/io/qloggingcategory.cpp30
-rw-r--r--src/corelib/io/qloggingcategory.h5
-rw-r--r--src/corelib/io/qprocess.cpp28
-rw-r--r--src/corelib/io/qprocess_win.cpp4
-rw-r--r--src/corelib/io/qsettings_win.cpp2
-rw-r--r--src/corelib/io/qtemporarydir.cpp8
-rw-r--r--src/corelib/io/qurl.cpp17
-rw-r--r--src/corelib/io/qurlquery.cpp8
11 files changed, 88 insertions, 34 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index cd30533ff8..5af398c360 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -515,6 +515,14 @@ inline void QDirPrivate::initFileEngine()
*/
/*!
+ \fn QDir &QDir::operator=(QDir &&other)
+
+ Move-assigns \a other to this QDir instance.
+
+ \since 5.2
+*/
+
+/*!
\internal
*/
QDir::QDir(QDirPrivate &p) : d_ptr(&p)
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 1d5f16c9d9..d1b7ebac65 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -294,6 +294,14 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request)
*/
/*!
+ \fn QFileInfo &QFileInfo::operator=(QFileInfo &&other)
+
+ Move-assigns \a other to this QFileInfo instance.
+
+ \since 5.2
+*/
+
+/*!
\internal
*/
QFileInfo::QFileInfo(QFileInfoPrivate *p) : d_ptr(p)
diff --git a/src/corelib/io/qfilesystemwatcher_win_p.h b/src/corelib/io/qfilesystemwatcher_win_p.h
index 790fb954d9..20dfe433ec 100644
--- a/src/corelib/io/qfilesystemwatcher_win_p.h
+++ b/src/corelib/io/qfilesystemwatcher_win_p.h
@@ -168,8 +168,8 @@ Q_SIGNALS:
void directoryChanged(const QString &path, bool removed);
};
-#endif // QT_NO_FILESYSTEMWATCHER
-
QT_END_NAMESPACE
+#endif // QT_NO_FILESYSTEMWATCHER
+
#endif // QFILESYSTEMWATCHER_WIN_P_H
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp
index 80acee6ad1..24eeb1584c 100644
--- a/src/corelib/io/qloggingcategory.cpp
+++ b/src/corelib/io/qloggingcategory.cpp
@@ -98,13 +98,28 @@ Q_GLOBAL_STATIC_WITH_ARGS(QLoggingCategory, qtDefaultCategory,
*/
/*!
+ \internal
+*/
+typedef QVector<QTracer *> Tracers;
+
+/*!
+ \internal
+*/
+class QLoggingCategoryPrivate
+{
+public:
+ Tracers tracers;
+};
+
+/*!
Constructs a QLoggingCategory object with the provided \a category name.
The object becomes the local identifier for the category.
If \a category is \c{0}, the category name is changed to \c{"default"}.
*/
QLoggingCategory::QLoggingCategory(const char *category)
- : name(0),
+ : d(new QLoggingCategoryPrivate),
+ name(0),
enabledDebug(false),
enabledWarning(true),
enabledCritical(true),
@@ -133,6 +148,7 @@ QLoggingCategory::~QLoggingCategory()
{
if (QLoggingRegistry *reg = QLoggingRegistry::instance())
reg->unregisterCategory(this);
+ delete d;
}
/*!
@@ -459,7 +475,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
void QTracer::addToCategory(QLoggingCategory &category)
{
- category.tracers.append(this);
+ category.d->tracers.append(this);
}
/*!
@@ -571,7 +587,7 @@ void QTracer::addToCategory(QLoggingCategory &category)
void QTraceGuard::start()
{
- QLoggingCategory::Tracers &tracers = target->tracers;
+ const Tracers &tracers = target->d->tracers;
for (int i = tracers.size(); --i >= 0; )
tracers.at(i)->start();
}
@@ -584,7 +600,7 @@ void QTraceGuard::start()
void QTraceGuard::end()
{
- QLoggingCategory::Tracers &tracers = target->tracers;
+ const Tracers &tracers = target->d->tracers;
for (int i = tracers.size(); --i >= 0; )
tracers.at(i)->end();
}
@@ -599,7 +615,7 @@ void QTraceGuard::end()
QTraceGuard &QTraceGuard::operator<<(int msg)
{
- QLoggingCategory::Tracers &tracers = target->tracers;
+ const Tracers &tracers = target->d->tracers;
for (int i = tracers.size(); --i >= 0; )
tracers.at(i)->record(msg);
return *this;
@@ -614,7 +630,7 @@ QTraceGuard &QTraceGuard::operator<<(int msg)
QTraceGuard &QTraceGuard::operator<<(const char *msg)
{
- QLoggingCategory::Tracers &tracers = target->tracers;
+ const Tracers &tracers = target->d->tracers;
for (int i = tracers.size(); --i >= 0; )
tracers.at(i)->record(msg);
return *this;
@@ -630,7 +646,7 @@ QTraceGuard &QTraceGuard::operator<<(const char *msg)
QTraceGuard &QTraceGuard::operator<<(const QVariant &msg)
{
- QLoggingCategory::Tracers &tracers = target->tracers;
+ const Tracers &tracers = target->d->tracers;
for (int i = tracers.size(); --i >= 0; )
tracers.at(i)->record(msg);
return *this;
diff --git a/src/corelib/io/qloggingcategory.h b/src/corelib/io/qloggingcategory.h
index 23b25b5e3f..70192fef13 100644
--- a/src/corelib/io/qloggingcategory.h
+++ b/src/corelib/io/qloggingcategory.h
@@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
class QTracer;
class QTraceGuard;
+class QLoggingCategoryPrivate;
class Q_CORE_EXPORT QLoggingCategory
{
@@ -80,18 +81,18 @@ public:
static void setFilterRules(const QString &rules);
private:
+ friend class QLoggingCategoryPrivate;
friend class QLoggingRegistry;
friend class QTraceGuard;
friend class QTracer;
+ QLoggingCategoryPrivate *d;
const char *name;
bool enabledDebug;
bool enabledWarning;
bool enabledCritical;
bool enabledTrace;
- typedef QVector<QTracer *> Tracers;
- Tracers tracers;
};
template <>
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 7f4d7f0313..fb86b053e9 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -854,8 +854,7 @@ void QProcessPrivate::cleanup()
pid = 0;
}
if (processFinishedNotifier) {
- processFinishedNotifier->setEnabled(false);
- qDeleteInEventHandler(processFinishedNotifier);
+ delete processFinishedNotifier;
processFinishedNotifier = 0;
}
@@ -865,33 +864,28 @@ void QProcessPrivate::cleanup()
dying = false;
if (stdoutChannel.notifier) {
- stdoutChannel.notifier->setEnabled(false);
- qDeleteInEventHandler(stdoutChannel.notifier);
+ delete stdoutChannel.notifier;
stdoutChannel.notifier = 0;
}
if (stderrChannel.notifier) {
- stderrChannel.notifier->setEnabled(false);
- qDeleteInEventHandler(stderrChannel.notifier);
+ delete stderrChannel.notifier;
stderrChannel.notifier = 0;
}
if (stdinChannel.notifier) {
- stdinChannel.notifier->setEnabled(false);
- qDeleteInEventHandler(stdinChannel.notifier);
+ delete stdinChannel.notifier;
stdinChannel.notifier = 0;
}
if (startupSocketNotifier) {
- startupSocketNotifier->setEnabled(false);
- qDeleteInEventHandler(startupSocketNotifier);
+ delete startupSocketNotifier;
startupSocketNotifier = 0;
}
if (deathNotifier) {
- deathNotifier->setEnabled(false);
- qDeleteInEventHandler(deathNotifier);
+ delete deathNotifier;
deathNotifier = 0;
}
#ifdef Q_OS_WIN
if (notifier) {
- qDeleteInEventHandler(notifier);
+ delete notifier;
notifier = 0;
}
#endif
@@ -1161,12 +1155,8 @@ void QProcessPrivate::closeWriteChannel()
qDebug("QProcessPrivate::closeWriteChannel()");
#endif
if (stdinChannel.notifier) {
- extern void qDeleteInEventHandler(QObject *o);
- stdinChannel.notifier->setEnabled(false);
- if (stdinChannel.notifier) {
- qDeleteInEventHandler(stdinChannel.notifier);
- stdinChannel.notifier = 0;
- }
+ delete stdinChannel.notifier;
+ stdinChannel.notifier = 0;
}
#ifdef Q_OS_WIN
// ### Find a better fix, feeding the process little by little
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 291ea319ec..dba9f62b98 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -654,11 +654,11 @@ bool QProcessPrivate::drainOutputPipes()
bool readOperationActive = false;
if (stdoutReader) {
readyReadEmitted |= stdoutReader->waitForReadyRead(0);
- readOperationActive = stdoutReader->isReadOperationActive();
+ readOperationActive = stdoutReader && stdoutReader->isReadOperationActive();
}
if (stderrReader) {
readyReadEmitted |= stderrReader->waitForReadyRead(0);
- readOperationActive |= stderrReader->isReadOperationActive();
+ readOperationActive |= stderrReader && stderrReader->isReadOperationActive();
}
someReadyReadEmitted |= readyReadEmitted;
if (!readOperationActive || !readyReadEmitted)
diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp
index 9ce14f1851..1d410862f0 100644
--- a/src/corelib/io/qsettings_win.cpp
+++ b/src/corelib/io/qsettings_win.cpp
@@ -450,7 +450,7 @@ QWinSettingsPrivate::QWinSettingsPrivate(QString rPath)
regList.append(RegistryKey(HKEY_CLASSES_ROOT, QString(), false));
else if (rPath.startsWith(QLatin1String("HKEY_USERS\\")))
regList.append(RegistryKey(HKEY_USERS, rPath.mid(11), false));
- else if (rPath == QLatin1String(QLatin1String("HKEY_USERS")))
+ else if (rPath == QLatin1String("HKEY_USERS"))
regList.append(RegistryKey(HKEY_USERS, QString(), false));
else
regList.append(RegistryKey(HKEY_LOCAL_MACHINE, rPath, false));
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp
index 755c31f371..f21403d7f1 100644
--- a/src/corelib/io/qtemporarydir.cpp
+++ b/src/corelib/io/qtemporarydir.cpp
@@ -299,7 +299,13 @@ bool QTemporaryDir::remove()
Q_ASSERT(!path().isEmpty());
Q_ASSERT(path() != QLatin1String("."));
- return QDir(path()).removeRecursively();
+ const bool result = QDir(path()).removeRecursively();
+ if (!result) {
+ qWarning() << "QTemporaryDir: Unable to remove"
+ << QDir::toNativeSeparators(path())
+ << "most likely due to the presence of read-only files.";
+ }
+ return result;
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 5535ae126a..d14add36a5 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -363,6 +363,23 @@
\sa QUrl::FormattingOptions
*/
+/*!
+ \fn QUrl::QUrl(QUrl &&other)
+
+ Move-constructs a QUrl instance, making it point at the same
+ object that \a other was pointing to.
+
+ \since 5.2
+*/
+
+/*!
+ \fn QUrl &QUrl::operator=(QUrl &&other)
+
+ Move-assigns \a other to this QUrl instance.
+
+ \since 5.2
+*/
+
#include "qurl.h"
#include "qurl_p.h"
#include "qplatformdefs.h"
diff --git a/src/corelib/io/qurlquery.cpp b/src/corelib/io/qurlquery.cpp
index f6b5cd44bd..f773af1433 100644
--- a/src/corelib/io/qurlquery.cpp
+++ b/src/corelib/io/qurlquery.cpp
@@ -139,6 +139,14 @@ QT_BEGIN_NAMESPACE
\sa QUrl
*/
+/*!
+ \fn QUrlQuery &QUrlQuery::operator=(QUrlQuery &&other)
+
+ Move-assigns \a other to this QUrlQuery instance.
+
+ \since 5.2
+*/
+
typedef QList<QPair<QString, QString> > Map;
class QUrlQueryPrivate : public QSharedData