summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-04-20 16:49:21 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-04-21 08:21:23 (GMT)
commit292a37301950a64f211e3a2909ff64884b73e1cc (patch)
treecf21b0824ffc294b5ddefd5bb4dab55add5f936b /src
parent7d572f0b4adf33db00352d8183b1e934cee85c39 (diff)
downloadQt-292a37301950a64f211e3a2909ff64884b73e1cc.zip
Qt-292a37301950a64f211e3a2909ff64884b73e1cc.tar.gz
Qt-292a37301950a64f211e3a2909ff64884b73e1cc.tar.bz2
Fix a bug in QFileDialog sidebar when the bookmark has an hidden parent
If the bookmark in the sidebar has an hidden parent and the QFileDialog is set up to not show hidden files, then clicking on the bookmark move the current dir to root (like if the bookmark was invalid) instead of entering in the dir. The fix was to fetch the parent dir and the bookmark dir when the user select it in the sidebar. Task-number: 251321 Reviewed-by: jasplin
Diffstat (limited to 'src')
-rw-r--r--src/gui/dialogs/qfiledialog.cpp5
-rw-r--r--src/gui/dialogs/qfilesystemmodel.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 9935a80..d786f3e 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -693,7 +693,10 @@ void QFileDialog::setVisible(bool visible)
*/
void QFileDialogPrivate::_q_goToUrl(const QUrl &url)
{
- QModelIndex idx = model->index(url.toLocalFile());
+ //The shortcut in the side bar may have a parent that is not fetched yet (e.g. an hidden file)
+ //so we force the fetching
+ QFileSystemModelPrivate::QFileSystemNode *node = model->d_func()->node(url.toLocalFile(), true);
+ QModelIndex idx = model->d_func()->index(node);
_q_enterDirectory(idx);
}
diff --git a/src/gui/dialogs/qfilesystemmodel.h b/src/gui/dialogs/qfilesystemmodel.h
index 52ecaf9..995268b 100644
--- a/src/gui/dialogs/qfilesystemmodel.h
+++ b/src/gui/dialogs/qfilesystemmodel.h
@@ -158,6 +158,8 @@ private:
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_resolvedName(const QString &fileName, const QString &resolvedName))
+
+ friend class QFileDialogPrivate;
};
inline bool QFileSystemModel::rmdir(const QModelIndex &aindex) const