diff options
author | jsc@umbraculum.org <jsc@umbraculum.org> | 2013-04-26 15:22:49 +0200 |
---|---|---|
committer | jsc@umbraculum.org <jsc@umbraculum.org> | 2013-04-26 15:22:49 +0200 |
commit | 2eedb967d2a3f8026163bd182e973106e6846a13 (patch) | |
tree | 71922ee5a65fa5d3af2719b4c853466eae27d5c5 /plugingui/filebrowser.cc | |
parent | dda686a04556a4cbbed0d8acf68c7d017b613024 (diff) |
Setting directory to previous selected directory when selecting new file.
Diffstat (limited to 'plugingui/filebrowser.cc')
-rw-r--r-- | plugingui/filebrowser.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugingui/filebrowser.cc b/plugingui/filebrowser.cc index 39cb565..21e3cc8 100644 --- a/plugingui/filebrowser.cc +++ b/plugingui/filebrowser.cc @@ -72,6 +72,8 @@ static void changeDir(void *ptr) { GUI::LineEdit *le = prv->lineedit; std::string value = lb->selectedValue(); Directory* dir = prv->dir; + + lb->clear(); INFO(filebrowser, "Changing path to '%s'\n", (dir->path() + "/" + value).c_str()); @@ -271,13 +273,16 @@ static bool isDir(std::string d) void GUI::FileBrowser::setPath(std::string path) { - WARN(filebrowser, "Not implemented yet!"); +// WARN(filebrowser, "Not implemented yet!"); // TODO: Remove this check to directoy.cc -// INFO(filebrowser, "Setting path to '%s'\n", path.c_str()); -// if(path.empty()) return; + INFO(filebrowser, "Setting path to '%s'\n", path.c_str()); + if(path.empty()) path = Directory::cwd(); // TODO: Strip path to set path to a directory -// prv->dir->setPath(path); + prv->dir->setPath(Directory::pathDirectory(path)); + prv->listbox->clear(); + + changeDir(prv); /* std::string dir; if(prv->dir->isDir()) { |