From 310b14903960fdf95ec85b09250b929588e7f006 Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Sat, 4 May 2013 19:55:04 +0200 Subject: testing windows drive selection --- plugingui/filebrowser.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'plugingui') diff --git a/plugingui/filebrowser.cc b/plugingui/filebrowser.cc index bb6f5de..ca4e0f5 100644 --- a/plugingui/filebrowser.cc +++ b/plugingui/filebrowser.cc @@ -76,7 +76,14 @@ static void changeDir(void *ptr) { lb->clear(); INFO(filebrowser, "Changing path to '%s'\n", (dir->path() + "/" + value).c_str()); - + +#ifdef WIN32 + if(!value.empty() && dir->isRoot()) { + dir->chdir(value); + return; + } +#endif + if(!value.empty() && dir->fileExists(value)) { std::string file = dir->path() + "/" + value; DEBUG(filebrowser, "Selecting file '%s'\n", file.c_str()); @@ -90,8 +97,6 @@ static void changeDir(void *ptr) { return; } - //TODO: If root and windows show drives instead of files - DEBUG(filebrowser, "Setting path of lineedit to %s\n", dir->path().c_str()); le->setText(dir->path()); -- cgit v1.2.3