diff options
author | Jonas Suhr Christensen <jsc@umbraculum.org> | 2013-05-04 19:27:32 +0200 |
---|---|---|
committer | Jonas Suhr Christensen <jsc@umbraculum.org> | 2013-05-04 19:27:32 +0200 |
commit | a93d2e811f26d291d2c1983318f585906c9b6d46 (patch) | |
tree | a41665a9124f3539d8b14ac37da9fdaf3d95f428 /plugingui/filebrowser.cc | |
parent | 6704a42a9b6e253ceb02a89523deb405f5d85300 (diff) |
Attempt to handle windows path in filebrowser
Diffstat (limited to 'plugingui/filebrowser.cc')
-rw-r--r-- | plugingui/filebrowser.cc | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/plugingui/filebrowser.cc b/plugingui/filebrowser.cc index 21e3cc8..bb6f5de 100644 --- a/plugingui/filebrowser.cc +++ b/plugingui/filebrowser.cc @@ -97,15 +97,34 @@ static void changeDir(void *ptr) { lb->clear(); std::vector<GUI::ListBoxBasic::Item> items; - Directory::EntryList entries = dir->entryList(); - for(Directory::EntryList::iterator it = entries.begin(); - it != entries.end(); it++) { - GUI::ListBoxBasic::Item item; - std::string name = *it; - item.name = name; - item.value = name; - items.push_back(item); + +#ifdef WIN32 + if(Directory::isRoot(dir->path()) && value == "..") { + DEBUG(filebrowser, "Showing partitions...\n"); + Directory::DriveList entries = dir->drives(); + for(Directory::DriveList::iterator it = entries.begin(); + it != entries.end(); it++) { + GUI::ListBoxBasic::Item item; + std::string name = (*it).name; + item.name = name; + item.value = name; + items.push_back(item); + } } + else { +#endif + Directory::EntryList entries = dir->entryList(); + for(Directory::EntryList::iterator it = entries.begin(); + it != entries.end(); it++) { + GUI::ListBoxBasic::Item item; + std::string name = *it; + item.name = name; + item.value = name; + items.push_back(item); + } +#ifdef WIN32 + } +#endif lb->addItems(items); } |