diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-14 22:03:50 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-14 22:03:50 (GMT) |
commit | 81a5b370a221ba1c5b37983786b490b9ceceea85 (patch) | |
tree | 3add6f969cddee8d210bf2767437c4a65bf98f92 /SwifTools/Application | |
parent | d1fa106d971cd898c288460fe727d4d088ba0556 (diff) | |
download | swift-contrib-81a5b370a221ba1c5b37983786b490b9ceceea85.zip swift-contrib-81a5b370a221ba1c5b37983786b490b9ceceea85.tar.bz2 |
Fixed UnixApplicationPathProvider.
Diffstat (limited to 'SwifTools/Application')
-rw-r--r-- | SwifTools/Application/UnixApplicationPathProvider.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/SwifTools/Application/UnixApplicationPathProvider.cpp b/SwifTools/Application/UnixApplicationPathProvider.cpp index 2ac39ab..c0d24ab 100644 --- a/SwifTools/Application/UnixApplicationPathProvider.cpp +++ b/SwifTools/Application/UnixApplicationPathProvider.cpp @@ -6,13 +6,17 @@ #include "SwifTools/Application/UnixApplicationPathProvider.h" +#include <boost/algorithm/string.hpp> + +#include <Swiften/Base/String.h> + namespace Swift { UnixApplicationPathProvider::UnixApplicationPathProvider(const std::string& name) : ApplicationPathProvider(name) { resourceDirs.push_back(getExecutableDir() / "../resources"); // Development char* xdgDataDirs = getenv("XDG_DATA_DIRS"); if (xdgDataDirs) { - std::vector<std::string> dataDirs = std::string(xdgDataDirs).split(':'); + std::vector<std::string> dataDirs = String::split(xdgDataDirs, ':'); if (!dataDirs.empty()) { foreach(const std::string& dir, dataDirs) { resourceDirs.push_back(boost::filesystem::path(dir) / "swift"); @@ -38,7 +42,7 @@ boost::filesystem::path UnixApplicationPathProvider::getDataDir() const { boost::filesystem::path dataPath = (dataDir.empty() ? getHomeDir() / ".local" / "share" - : boost::filesystem::path(dataDir)) / getApplicationName().getLowerCase(); + : boost::filesystem::path(dataDir)) / boost::to_lower_copy(getApplicationName()); try { boost::filesystem::create_directories(dataPath); |