From a37ed02f8f964a1ad0371ed903ea02d51bae794d Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 3 May 2010 20:28:34 +0200 Subject: [PATCH] browserdialog: Better path handling. --- src/browsedialog.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/browsedialog.cpp b/src/browsedialog.cpp index 79835c4..9e40ce2 100644 --- a/src/browsedialog.cpp +++ b/src/browsedialog.cpp @@ -35,7 +35,7 @@ bool BrowseDialog::exec() return false; string path = fl->getPath(); - if (path.empty() || !fileExists(path)) + if (path.empty() || !fileExists(path) || path.compare(0, 5, "/card") != 0) setPath("/card"); fl->browse(); @@ -169,7 +169,12 @@ void BrowseDialog::directoryUp() void BrowseDialog::directoryEnter() { - setPath(fl->getPath() + "/" + fl->at(selected)); + string path = fl->getPath(); + if (path[path.size()-1] != '/') + path += "/"; + + setPath(path + fl->at(selected)); + selected = 0; }