diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-11-23 14:47:05 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-11-28 16:38:32 +0000 |
commit | 61cefb2f7a7cb16dfa2732e26d2319017039ef62 (patch) | |
tree | 8ec3fbd1e556bd185e53cc0d0fbf357e01fc174e /src/widgets/dialogs/qfilesystemmodel.cpp | |
parent | 678a4273a30e9e073dabe684ba21f18faf426e15 (diff) |
De-inline QFileSystemModel::fileInfo() and implement it efficiently
De-inline the method, and return the file info that's already being
cached by the model.
This is ok to do in a minor release, as apps compiled against an older
version of Qt will simply continue to use the less efficient
implementation.
Change-Id: I164c7961a8cf97447638af316512326442767dd8
Task-number: QTBUG-30902
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/widgets/dialogs/qfilesystemmodel.cpp')
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index b1e77540e7..6bce7e99f5 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -154,6 +154,11 @@ QT_BEGIN_NAMESPACE Returns the QFileInfo for the item stored in the model under the given \a index. */ +QFileInfo QFileSystemModel::fileInfo(const QModelIndex &index) const +{ + Q_D(const QFileSystemModel); + return d->node(index)->fileInfo(); +} /*! \fn void QFileSystemModel::rootPathChanged(const QString &newPath); |