diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfileselector.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp index ce06c8e00b..500b475d1d 100644 --- a/src/corelib/io/qfileselector.cpp +++ b/src/corelib/io/qfileselector.cpp @@ -228,7 +228,18 @@ QUrl QFileSelector::select(const QUrl &filePath) const QString selectedPath = d->select(equivalentPath); ret.setPath(selectedPath.remove(0, scheme.size())); } else { + // we need to store the original query and fragment, since toLocalFile() will strip it off + QString frag; + if (ret.hasFragment()) + frag = ret.fragment(); + QString query; + if (ret.hasQuery()) + query= ret.query(); ret = QUrl::fromLocalFile(d->select(ret.toLocalFile())); + if (!frag.isNull()) + ret.setFragment(frag); + if (!query.isNull()) + ret.setQuery(query); } return ret; } |