From 4d86a47b8cf90beaf0fb90196a46d2d23eba43b7 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 5 May 2013 22:26:44 +0200 Subject: Dirty fixing win32 filebrowser. --- plugingui/filebrowser.cc | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'plugingui/filebrowser.cc') diff --git a/plugingui/filebrowser.cc b/plugingui/filebrowser.cc index 6aaa6b7..d4acdd6 100644 --- a/plugingui/filebrowser.cc +++ b/plugingui/filebrowser.cc @@ -54,6 +54,7 @@ struct GUI::FileBrowser::private_data { Directory *dir; #ifdef WIN32 bool above_root; + bool in_root; #endif }; @@ -72,14 +73,15 @@ 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()); #ifdef WIN32 if(prv->above_root && !value.empty()) { - dir->setPath(value); +DEBUG(filebrowser, "AAAA"); + dir->setPath(value+"\\"); value.clear(); prv->above_root = false; } @@ -92,16 +94,7 @@ static void changeDir(void *ptr) { return; } - if(!value.empty() && !dir->cd(value)) { - DEBUG(filebrowser, "Error changing to '%s'\n", - (dir->path() + "/" + value).c_str()); - return; - } - - DEBUG(filebrowser, "Setting path of lineedit to %s\n", dir->path().c_str()); - le->setText(dir->path()); - lb->clear(); std::vector items; #ifdef WIN32 @@ -120,7 +113,17 @@ static void changeDir(void *ptr) { } else { #endif - Directory::EntryList entries = dir->entryList(); + + if(!value.empty() && !dir->cd(value)) { + DEBUG(filebrowser, "Error changing to '%s'\n", + (dir->path() + "/" + value).c_str()); + return; + } + + DEBUG(filebrowser, "Setting path of lineedit to %s\n", dir->path().c_str()); + le->setText(dir->path()); + +Directory::EntryList entries = dir->entryList(); for(Directory::EntryList::iterator it = entries.begin(); it != entries.end(); it++) { GUI::ListBoxBasic::Item item; -- cgit v1.2.3