summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-06-09 18:13:35 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-06-09 18:13:35 (GMT)
commit3de4268ade36c9292a88b1da7604748a87c65777 (patch)
treeec64d31cbc5aa9adf3294c36eebb5b5919db6f21 /Swiften
parentd05ac626d89c0d4ef91a972b9927d248c1e48b79 (diff)
downloadswift-3de4268ade36c9292a88b1da7604748a87c65777.zip
swift-3de4268ade36c9292a88b1da7604748a87c65777.tar.bz2
Added Application::getProfileDir().
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Application/Application.cpp6
-rw-r--r--Swiften/Application/Application.h1
-rw-r--r--Swiften/Application/Windows/WindowsApplication.h3
3 files changed, 7 insertions, 3 deletions
diff --git a/Swiften/Application/Application.cpp b/Swiften/Application/Application.cpp
index 52fd14c..e21d9e7 100644
--- a/Swiften/Application/Application.cpp
+++ b/Swiften/Application/Application.cpp
@@ -24,4 +24,10 @@ boost::filesystem::path Application::getHomeDir() const {
return homeDir;
}
+boost::filesystem::path Application::getProfileDir(const String& profile) const {
+ boost::filesystem::path result(getHomeDir() / profile.getUTF8String());
+ boost::filesystem::create_directory(result);
+ return result;
+}
+
}
diff --git a/Swiften/Application/Application.h b/Swiften/Application/Application.h
index 4900107..4fda7af 100644
--- a/Swiften/Application/Application.h
+++ b/Swiften/Application/Application.h
@@ -16,6 +16,7 @@ namespace Swift {
boost::filesystem::path getSettingsFileName() const;
boost::filesystem::path getHomeDir() const;
virtual boost::filesystem::path getSettingsDir() const = 0;
+ boost::filesystem::path getProfileDir(const String& profile) const;
const String& getName() const {
return name_;
diff --git a/Swiften/Application/Windows/WindowsApplication.h b/Swiften/Application/Windows/WindowsApplication.h
index 0fc4b12..9f1abb4 100644
--- a/Swiften/Application/Windows/WindowsApplication.h
+++ b/Swiften/Application/Windows/WindowsApplication.h
@@ -1,8 +1,6 @@
#ifndef SWIFTEN_WindowsApplication_H
#define SWIFTEN_WindowsApplication_H
-#include <cassert>
-
#include "Swiften/Application/Application.h"
#include "Swiften/Application/NullApplicationMessageDisplay.h"
@@ -18,7 +16,6 @@ namespace Swift {
}
boost::filesystem::path getSettingsDir() const {
- assert(false);
// FIXME: This is wrong
boost::filesystem::path result(getHomeDir() / ("." + getName().getUTF8String()));
boost::filesystem::create_directory(result);