Mercurial > hg > octave-nkf
changeset 18472:6ebd37faae5f gui-release
Add path separator to end of uigetfile path (Bug #41367)
* libgui/src/dialog.cc
(FileDialog::accept): Add / to pathname if showing files dialog. Convert path to native separators.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Tue, 28 Jan 2014 18:17:57 -0500 |
parents | 2ea741d22554 |
children | 187f3a3429e1 |
files | libgui/src/dialog.cc |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/dialog.cc +++ b/libgui/src/dialog.cc @@ -491,8 +491,14 @@ for (int i = 0; i < string_result.size (); i++) string_result[i] = QFileInfo (string_result[i]).fileName (); + path = directory ().absolutePath (); - path = directory ().absolutePath (); + // if not showing only dirs, add end slash for the path component + if (testOption (QFileDialog::ShowDirsOnly) == false) + path = path + "/"; + + // convert to native slashes + path = QDir::toNativeSeparators (path); QStringList name_filters = nameFilters (); idx = name_filters.indexOf (selectedNameFilter ()) + 1;