summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-05-27 20:01:04 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-05-27 20:01:04 +0200
commit776544e63ed9a7a2c90c6b26f847b18882ee5146 (patch)
tree8ef881b77ae2be15fb0533cff4da671d660cc8a1 /plugingui
parent72662f3eee9ba918b623c5e7ba93c5c3b758d8dc (diff)
Missing SEP conversions.
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/directory.cc11
-rw-r--r--plugingui/directory.h2
-rw-r--r--plugingui/filebrowser.cc8
3 files changed, 14 insertions, 7 deletions
diff --git a/plugingui/directory.cc b/plugingui/directory.cc
index 18ec336..85e34aa 100644
--- a/plugingui/directory.cc
+++ b/plugingui/directory.cc
@@ -58,6 +58,11 @@ Directory::~Directory()
{
}
+std::string Directory::seperator()
+{
+ return SEP;
+}
+
void Directory::setPath(std::string path)
{
DEBUG(directory, "Setting path to '%s'\n", path.c_str());
@@ -149,7 +154,7 @@ Directory::EntryList Directory::listFiles(std::string path)
entrypath += entry->d_name;
if(Directory::isDir(entrypath)) {
if(name == "..") directories.push_back(entry->d_name);
- else directories.push_back(std::string("/") + entry->d_name);
+ else directories.push_back(std::string(SEP) + entry->d_name);
}
else {
int drumkit_suffix_length = strlen(DRUMKIT_SUFFIX);
@@ -223,7 +228,7 @@ bool Directory::isRoot(std::string path)
return false;
}
#else
- if(path == "/") return true;
+ if(path == SEP) return true;
else return false;
#endif
}
@@ -242,7 +247,7 @@ std::string Directory::root(std::string path)
return path.substr(0, 2);
}
#else
- return "/";
+ return SEP;
#endif
}
diff --git a/plugingui/directory.h b/plugingui/directory.h
index 9e184d4..50d5fae 100644
--- a/plugingui/directory.h
+++ b/plugingui/directory.h
@@ -50,6 +50,8 @@ class Directory {
Directory(std::string path);
~Directory();
+ std::string seperator();
+
size_t count();
void refresh();
std::string path();
diff --git a/plugingui/filebrowser.cc b/plugingui/filebrowser.cc
index 9d5ae35..fcd4b9c 100644
--- a/plugingui/filebrowser.cc
+++ b/plugingui/filebrowser.cc
@@ -76,11 +76,11 @@ static void changeDir(void *ptr)
lb->clear();
INFO(filebrowser, "Changing path to '%s'\n",
- (dir->path() + "/" + value).c_str());
+ (dir->path() + dir->seperator() + value).c_str());
#ifdef WIN32
if(prv->above_root && !value.empty()) {
- dir->setPath(value+"\\");
+ dir->setPath(value + dir->seperator());
value.clear();
prv->above_root = false;
}
@@ -93,7 +93,7 @@ static void changeDir(void *ptr)
}
if(!value.empty() && dir->fileExists(value)) {
- std::string file = dir->path() + "/" + value;
+ std::string file = dir->path() + dir->seperator() + value;
DEBUG(filebrowser, "Selecting file '%s'\n", file.c_str());
if(prv->filesel_handler) prv->filesel_handler(prv->ptr, file);
return;
@@ -119,7 +119,7 @@ static void changeDir(void *ptr)
if(!value.empty() && !dir->cd(value)) {
DEBUG(filebrowser, "Error changing to '%s'\n",
- (dir->path() + "/" + value).c_str());
+ (dir->path() + dir->seperator() + value).c_str());
return;
}