Commit 1a8ef7f3 authored by Petar Perisin's avatar Petar Perisin Committed by Eike Ziller
Browse files

PathChooser - fix handling of predefined path

predefined path was not set when path chooser was set to select files.

Change-Id: I2a9b3d9f2d84b0c5f048bde8e098c6c17772e957
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <>
Reviewed-by: default avatarEike Ziller <>
parent 8d96ce55
......@@ -357,11 +357,21 @@ void PathChooser::slotBrowse()
emit beforeBrowsing();
QString predefined = path();
if ((predefined.isEmpty() || !QFileInfo(predefined).isDir())
QFileInfo fi(predefined);
if (!predefined.isEmpty() && !fi.isDir()) {
predefined = fi.path();
if ((predefined.isEmpty() || !fi.isDir())
&& !d->m_initialBrowsePathOverride.isNull()) {
predefined = d->m_initialBrowsePathOverride;
if (!QFileInfo(predefined).isDir())
if (!fi.isDir()) {
// Prompt for a file/dir
......@@ -392,7 +402,6 @@ void PathChooser::slotBrowse()
QFileDialog dialog(this);
dialog.setWindowTitle(makeDialogTitle(tr("Choose File")));
QFileInfo fi(predefined);
if (fi.exists())
// FIXME: fix QFileDialog so that it filters properly: lib*.a
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment