summaryrefslogtreecommitdiff
path: root/plugingui/filebrowser.cc
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2013-05-04 20:11:44 +0200
committerJonas Suhr Christensen <jsc@umbraculum.org>2013-05-04 20:11:44 +0200
commite93473c92997c462a76ba370c7373d800112384b (patch)
treefa175589941c3b6e6a814cd856748f7b6c8a6fcf /plugingui/filebrowser.cc
parent4bac87165d5274b1512b7f9fe1f67cc454488988 (diff)
Windows filebrowser fixing
Diffstat (limited to 'plugingui/filebrowser.cc')
-rw-r--r--plugingui/filebrowser.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugingui/filebrowser.cc b/plugingui/filebrowser.cc
index 26d58b1..6aaa6b7 100644
--- a/plugingui/filebrowser.cc
+++ b/plugingui/filebrowser.cc
@@ -52,9 +52,9 @@ struct GUI::FileBrowser::private_data {
void (*filesel_handler)(void *, std::string);
void *ptr;
Directory *dir;
-//#ifdef WIN32
-// int drvidx;
-//#endif
+#ifdef WIN32
+ bool above_root;
+#endif
};
static void cancel(void *ptr)
@@ -78,9 +78,10 @@ static void changeDir(void *ptr) {
INFO(filebrowser, "Changing path to '%s'\n", (dir->path() + "/" + value).c_str());
#ifdef WIN32
- if(!value.empty() && Directory::isRoot(dir->path())) {
+ if(prv->above_root && !value.empty()) {
dir->setPath(value);
- return;
+ value.clear();
+ prv->above_root = false;
}
#endif
@@ -115,6 +116,7 @@ static void changeDir(void *ptr) {
item.value = name;
items.push_back(item);
}
+ prv->above_root = true;
}
else {
#endif
@@ -226,6 +228,9 @@ GUI::FileBrowser::FileBrowser(GUI::Widget *parent)
prv->filesel_handler = NULL;
prv->dir = new Directory(Directory::cwd());
+#ifdef WIN32
+ prv->above_root = false;
+#endif
lbl_path.setText("Path:");