summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qfileinfogatherer.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2012-08-07 19:45:16 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-25 00:08:16 +0200
commit07c44f7bd3c0b6061cba5a525995f616f1083672 (patch)
tree3f7574c198c15fd1bfa6d363231c270b2016fa45 /src/widgets/dialogs/qfileinfogatherer.cpp
parent0c2b7b1020384c095500599a687a88306f98c0f6 (diff)
QFileInfoGatherer: general cleanups
- fix typo in comment - make translateDriveName file-static - use QList::reserve() - explicit ctor - annotate functions called by owning thread/run() - iconProvider() and resolveSymlinks() shouldn't be slots - private instead of protected - run() marked Q_DECL_OVERRIDE - annotate which members are protected by 'mutex' Change-Id: Ic176a030b0597c98f48185efd17260fd62532460 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets/dialogs/qfileinfogatherer.cpp')
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index d1718bb5bf..22a7d50f7c 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -129,7 +129,7 @@ QFileIconProvider *QFileInfoGatherer::iconProvider() const
void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStringList &files)
{
QMutexLocker locker(&mutex);
- // See if we already have this dir/file in our que
+ // See if we already have this dir/file in our queue
int loc = this->path.lastIndexOf(path);
while (loc > 0) {
if (this->files.at(loc) == files) {
@@ -243,7 +243,7 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
return info;
}
-QString QFileInfoGatherer::translateDriveName(const QFileInfo &drive) const
+static QString translateDriveName(const QFileInfo &drive)
{
QString driveName = drive.absoluteFilePath();
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
@@ -280,6 +280,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
if (files.isEmpty()) {
infoList = QDir::drives();
} else {
+ infoList.reserve(files.count());
for (int i = 0; i < files.count(); ++i)
infoList << QFileInfo(files.at(i));
}