summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-11-24 09:21:53 +0100
committerLars Knoll <lars.knoll@theqtcompany.com>2015-11-30 12:22:21 +0000
commite808c5fa6096eb4bc84b6d90c9befa9e805fa680 (patch)
treec3b829ebe16943c7cc6d2cc802d26b4889810d6e /src
parentca14600965479dd3d255b734a0fe54bb2ba7892d (diff)
Don't use QList<QPair>
Change it to use a QVector instead. Change-Id: Ie1749f326ba1165db48c0eb8763eb738672c7afd Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp6
-rw-r--r--src/widgets/dialogs/qfileinfogatherer_p.h4
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp10
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.h2
-rw-r--r--src/widgets/dialogs/qfilesystemmodel_p.h2
5 files changed, 12 insertions, 12 deletions
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index 7329019a87..92d6b8f3be 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -287,7 +287,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
}
for (int i = infoList.count() - 1; i >= 0; --i) {
QString driveName = translateDriveName(infoList.at(i));
- QList<QPair<QString,QFileInfo> > updatedFiles;
+ QVector<QPair<QString,QFileInfo> > updatedFiles;
updatedFiles.append(QPair<QString,QFileInfo>(driveName, infoList.at(i)));
emit updates(path, updatedFiles);
}
@@ -298,7 +298,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
base.start();
QFileInfo fileInfo;
bool firstTime = true;
- QList<QPair<QString, QFileInfo> > updatedFiles;
+ QVector<QPair<QString, QFileInfo> > updatedFiles;
QStringList filesToCheck = files;
QString itPath = QDir::fromNativeSeparators(files.isEmpty() ? path : QLatin1String(""));
@@ -324,7 +324,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
emit directoryLoaded(path);
}
-void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bool &firstTime, QList<QPair<QString, QFileInfo> > &updatedFiles, const QString &path) {
+void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bool &firstTime, QVector<QPair<QString, QFileInfo> > &updatedFiles, const QString &path) {
updatedFiles.append(QPair<QString, QFileInfo>(fileInfo.fileName(), fileInfo));
QElapsedTimer current;
current.start();
diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h
index 6bd15b5388..03f87fdba5 100644
--- a/src/widgets/dialogs/qfileinfogatherer_p.h
+++ b/src/widgets/dialogs/qfileinfogatherer_p.h
@@ -149,7 +149,7 @@ class Q_AUTOTEST_EXPORT QFileInfoGatherer : public QThread
Q_OBJECT
Q_SIGNALS:
- void updates(const QString &directory, const QList<QPair<QString, QFileInfo> > &updates);
+ void updates(const QString &directory, const QVector<QPair<QString, QFileInfo> > &updates);
void newListOfFiles(const QString &directory, const QStringList &listOfFiles) const;
void nameResolved(const QString &fileName, const QString &resolvedName) const;
void directoryLoaded(const QString &path);
@@ -176,7 +176,7 @@ private:
void run() Q_DECL_OVERRIDE;
// called by run():
void getFileInfos(const QString &path, const QStringList &files);
- void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime, QList<QPair<QString, QFileInfo> > &updatedFiles, const QString &path);
+ void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime, QVector<QPair<QString, QFileInfo> > &updatedFiles, const QString &path);
private:
mutable QMutex mutex;
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index cfc6b9c4cc..5dd8c05734 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -1110,7 +1110,7 @@ void QFileSystemModel::sort(int column, Qt::SortOrder order)
emit layoutAboutToBeChanged();
QModelIndexList oldList = persistentIndexList();
- QList<QPair<QFileSystemModelPrivate::QFileSystemNode*, int> > oldNodes;
+ QVector<QPair<QFileSystemModelPrivate::QFileSystemNode*, int> > oldNodes;
const int nodeCount = oldList.count();
oldNodes.reserve(nodeCount);
for (int i = 0; i < nodeCount; ++i) {
@@ -1756,7 +1756,7 @@ void QFileSystemModelPrivate::removeVisibleFile(QFileSystemNode *parentNode, int
The thread has received new information about files,
update and emit dataChanged if it has actually changed.
*/
-void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QList<QPair<QString, QFileInfo> > &updates)
+void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QVector<QPair<QString, QFileInfo> > &updates)
{
#ifndef QT_NO_FILESYSTEMWATCHER
Q_Q(QFileSystemModel);
@@ -1875,12 +1875,12 @@ void QFileSystemModelPrivate::_q_resolvedName(const QString &fileName, const QSt
void QFileSystemModelPrivate::init()
{
Q_Q(QFileSystemModel);
- qRegisterMetaType<QList<QPair<QString,QFileInfo> > >();
+ qRegisterMetaType<QVector<QPair<QString,QFileInfo> > >();
#ifndef QT_NO_FILESYSTEMWATCHER
q->connect(&fileInfoGatherer, SIGNAL(newListOfFiles(QString,QStringList)),
q, SLOT(_q_directoryChanged(QString,QStringList)));
- q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QList<QPair<QString,QFileInfo> >)),
- q, SLOT(_q_fileSystemChanged(QString,QList<QPair<QString,QFileInfo> >)));
+ q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QVector<QPair<QString,QFileInfo> >)),
+ q, SLOT(_q_fileSystemChanged(QString,QVector<QPair<QString,QFileInfo> >)));
q->connect(&fileInfoGatherer, SIGNAL(nameResolved(QString,QString)),
q, SLOT(_q_resolvedName(QString,QString)));
q->connect(&fileInfoGatherer, SIGNAL(directoryLoaded(QString)),
diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h
index add1a7241a..515417f225 100644
--- a/src/widgets/dialogs/qfilesystemmodel.h
+++ b/src/widgets/dialogs/qfilesystemmodel.h
@@ -146,7 +146,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_directoryChanged(const QString &directory, const QStringList &list))
Q_PRIVATE_SLOT(d_func(), void _q_performDelayedSort())
- Q_PRIVATE_SLOT(d_func(), void _q_fileSystemChanged(const QString &path, const QList<QPair<QString, QFileInfo> > &))
+ Q_PRIVATE_SLOT(d_func(), void _q_fileSystemChanged(const QString &path, const QVector<QPair<QString, QFileInfo> > &))
Q_PRIVATE_SLOT(d_func(), void _q_resolvedName(const QString &fileName, const QString &resolvedName))
friend class QFileDialogPrivate;
diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h
index a35c50bfc7..d2a40a1cb5 100644
--- a/src/widgets/dialogs/qfilesystemmodel_p.h
+++ b/src/widgets/dialogs/qfilesystemmodel_p.h
@@ -283,7 +283,7 @@ public:
void _q_directoryChanged(const QString &directory, const QStringList &list);
void _q_performDelayedSort();
- void _q_fileSystemChanged(const QString &path, const QList<QPair<QString, QFileInfo> > &);
+ void _q_fileSystemChanged(const QString &path, const QVector<QPair<QString, QFileInfo> > &);
void _q_resolvedName(const QString &fileName, const QString &resolvedName);
static int naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs);