summaryrefslogtreecommitdiff
path: root/plugingui/filebrowser.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-05-05 22:26:44 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-05-05 22:26:44 +0200
commit4d86a47b8cf90beaf0fb90196a46d2d23eba43b7 (patch)
treea4a0404359d8fcceafdc785b991fd9bbc2e84ef9 /plugingui/filebrowser.cc
parent014eaaed5806deae317a87312e8433dac79c0777 (diff)
Dirty fixing win32 filebrowser.
Diffstat (limited to 'plugingui/filebrowser.cc')
-rw-r--r--plugingui/filebrowser.cc27
1 files changed, 15 insertions, 12 deletions
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<GUI::ListBoxBasic::Item> 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;