summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qsidebar_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2013-10-06 22:50:12 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-01-18 10:34:24 +0000
commitea76ab2b2ded0197ddf9e33e8d6a8af909fce31c (patch)
tree550b08d1e6be098dda312551c5465fd9fd26793f /src/widgets/dialogs/qsidebar_p.h
parentb30ea419450c968c009ddcae964b1b54755f11ac (diff)
QtWidgets: replace uses of inefficient QList<QPair>s with QVectors
These QPairs are larger than a void*, so holding them in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by holding them in QVector instead. Change-Id: I3c205f5326cfd96482563078bdca1747d718457f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/dialogs/qsidebar_p.h')
-rw-r--r--src/widgets/dialogs/qsidebar_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qsidebar_p.h b/src/widgets/dialogs/qsidebar_p.h
index f3e20986f0..210c86be01 100644
--- a/src/widgets/dialogs/qsidebar_p.h
+++ b/src/widgets/dialogs/qsidebar_p.h
@@ -55,6 +55,7 @@
#include <qstandarditemmodel.h>
#include <qstyleditemdelegate.h>
#include <qurl.h>
+#include <qvector.h>
#ifndef QT_NO_FILEDIALOG
@@ -106,7 +107,7 @@ private:
void changed(const QString &path);
void addIndexToWatch(const QString &path, const QModelIndex &index);
QFileSystemModel *fileSystemModel;
- QList<QPair<QModelIndex, QString> > watching;
+ QVector<QPair<QModelIndex, QString> > watching;
QList<QUrl> invalidUrls;
};