From 3de4268ade36c9292a88b1da7604748a87c65777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Tue, 9 Jun 2009 20:13:35 +0200 Subject: Added Application::getProfileDir(). 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 - #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); -- cgit v0.10.2-6-g49f6