diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-08-19 18:02:47 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-08-19 18:02:47 (GMT) |
commit | 3a7c72e4d4ef968f87425b3394eb5e2aa7882e20 (patch) | |
tree | 089f1b62e8462e5c55e06a77aa416755d9e299f8 /Swiften/Application | |
parent | f416fe2749a959ad26544ead709683d3800059e4 (diff) | |
download | swift-3a7c72e4d4ef968f87425b3394eb5e2aa7882e20.zip swift-3a7c72e4d4ef968f87425b3394eb5e2aa7882e20.tar.bz2 |
Fixed compilation on OS X.
Diffstat (limited to 'Swiften/Application')
-rw-r--r-- | Swiften/Application/MacOSX/MacOSXApplication.cpp | 15 | ||||
-rw-r--r-- | Swiften/Application/MacOSX/MacOSXApplication.h | 11 | ||||
-rw-r--r-- | Swiften/Application/MacOSXApplicationPathProvider.cpp | 4 | ||||
-rw-r--r-- | Swiften/Application/SConscript | 2 |
4 files changed, 7 insertions, 25 deletions
diff --git a/Swiften/Application/MacOSX/MacOSXApplication.cpp b/Swiften/Application/MacOSX/MacOSXApplication.cpp index 8e9a948..8212d36 100644 --- a/Swiften/Application/MacOSX/MacOSXApplication.cpp +++ b/Swiften/Application/MacOSX/MacOSXApplication.cpp @@ -17,19 +17,4 @@ ApplicationMessageDisplay* MacOSXApplication::getApplicationMessageDisplay() { return &messageDisplay_; } -boost::filesystem::path MacOSXApplication::getSettingsDir() const { - try { - boost::filesystem::path result(getHomeDir() / "Library/Application Support" / getName().getUTF8String()); - } - catch (const boost::filesystem::filesystem_error& e) { - std::cerr << "ERROR: " << e.what() << std::endl; - } - boost::filesystem::create_directory(result); - return result; -} - -boost::filesystem::path MacOSXApplication::getHomeDir() const { - return boost::filesystem::path(getenv("HOME")); -} - } diff --git a/Swiften/Application/MacOSX/MacOSXApplication.h b/Swiften/Application/MacOSX/MacOSXApplication.h index 95bf29e..f753f72 100644 --- a/Swiften/Application/MacOSX/MacOSXApplication.h +++ b/Swiften/Application/MacOSX/MacOSXApplication.h @@ -4,8 +4,9 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_MacOSXApplication_H -#define SWIFTEN_MacOSXApplication_H +#pragma once + +#include <boost/filesystem.hpp> #include "Swiften/Application/Application.h" #include "Swiften/Application/MacOSX/MacOSXApplicationMessageDisplay.h" @@ -18,14 +19,10 @@ namespace Swift { public: MacOSXApplication(const String& name); - virtual boost::filesystem::path getHomeDir() const; - virtual ApplicationMessageDisplay* getApplicationMessageDisplay(); - boost::filesystem::path getSettingsDir() const; + ApplicationMessageDisplay* getApplicationMessageDisplay(); private: MacOSXApplicationInitializer initializer_; MacOSXApplicationMessageDisplay messageDisplay_; }; } - -#endif diff --git a/Swiften/Application/MacOSXApplicationPathProvider.cpp b/Swiften/Application/MacOSXApplicationPathProvider.cpp index e679517..3b9a797 100644 --- a/Swiften/Application/MacOSXApplicationPathProvider.cpp +++ b/Swiften/Application/MacOSXApplicationPathProvider.cpp @@ -14,13 +14,13 @@ MacOSXApplicationPathProvider::MacOSXApplicationPathProvider(const String& name) } boost::filesystem::path MacOSXApplicationPathProvider::getSettingsDir() const { + boost::filesystem::path result(getHomeDir() / "Library/Application Support" / getApplicationName().getUTF8String()); try { - boost::filesystem::path result(getHomeDir() / "Library/Application Support" / getApplicationName().getUTF8String()); + boost::filesystem::create_directory(result); } catch (const boost::filesystem::filesystem_error& e) { std::cerr << "ERROR: " << e.what() << std::endl; } - boost::filesystem::create_directory(result); return result; } diff --git a/Swiften/Application/SConscript b/Swiften/Application/SConscript index 69e755a..2eacc80 100644 --- a/Swiften/Application/SConscript +++ b/Swiften/Application/SConscript @@ -11,7 +11,7 @@ if swiften_env["PLATFORM"] == "darwin" and swiften_env["target"] == "native" : "MacOSX/MacOSXApplication.cpp", "MacOSX/MacOSXApplicationMessageDisplay.mm", "MacOSX/MacOSXApplicationInitializer.mm", - "MacOSX/MacOSXApplicationPathProvider.cpp", + "MacOSXApplicationPathProvider.cpp", ] elif swiften_env["PLATFORM"] == "win32" : sources += [ |