diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-08-20 19:26:47 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-08-20 19:26:47 (GMT) |
commit | b620cf7471f80361522dd2232c54068bce4a42be (patch) | |
tree | d59fb2c7ba56192535fbdfd25e87afac638d13a3 /Swiften/Application | |
parent | 8acd1155de2cfbe7d7f1716566418f84fbd55a07 (diff) | |
download | swift-b620cf7471f80361522dd2232c54068bce4a42be.zip swift-b620cf7471f80361522dd2232c54068bce4a42be.tar.bz2 |
getExecutableDir() -> getDataDir().
Diffstat (limited to 'Swiften/Application')
7 files changed, 9 insertions, 14 deletions
diff --git a/Swiften/Application/ApplicationPathProvider.cpp b/Swiften/Application/ApplicationPathProvider.cpp index 47ef1ad..f24aa2e 100644 --- a/Swiften/Application/ApplicationPathProvider.cpp +++ b/Swiften/Application/ApplicationPathProvider.cpp @@ -20,12 +20,8 @@ ApplicationPathProvider::ApplicationPathProvider(const String& applicationName) ApplicationPathProvider::~ApplicationPathProvider() { } -boost::filesystem::path ApplicationPathProvider::getSettingsFileName() const { - return getSettingsDir() / "settings"; -} - boost::filesystem::path ApplicationPathProvider::getAvatarDir() const { - return getSettingsDir() / "avatars"; + return getDataDir() / "avatars"; } boost::filesystem::path ApplicationPathProvider::getProfileDir(const String& profile) const { diff --git a/Swiften/Application/ApplicationPathProvider.h b/Swiften/Application/ApplicationPathProvider.h index e9c0864..7bd2630 100644 --- a/Swiften/Application/ApplicationPathProvider.h +++ b/Swiften/Application/ApplicationPathProvider.h @@ -17,10 +17,9 @@ namespace Swift { ApplicationPathProvider(const String& applicationName); virtual ~ApplicationPathProvider(); - boost::filesystem::path getSettingsFileName() const; boost::filesystem::path getAvatarDir() const; virtual boost::filesystem::path getHomeDir() const = 0; - virtual boost::filesystem::path getSettingsDir() const = 0; + virtual boost::filesystem::path getDataDir() const = 0; virtual boost::filesystem::path getExecutableDir() const = 0; boost::filesystem::path getProfileDir(const String& profile) const; boost::filesystem::path getResourcePath(const String& resource) const; diff --git a/Swiften/Application/MacOSXApplicationPathProvider.cpp b/Swiften/Application/MacOSXApplicationPathProvider.cpp index 08ce885..8ff4cb3 100644 --- a/Swiften/Application/MacOSXApplicationPathProvider.cpp +++ b/Swiften/Application/MacOSXApplicationPathProvider.cpp @@ -18,7 +18,7 @@ MacOSXApplicationPathProvider::MacOSXApplicationPathProvider(const String& name) resourceDirs.push_back(getExecutableDir() / "../resources"); // Development } -boost::filesystem::path MacOSXApplicationPathProvider::getSettingsDir() const { +boost::filesystem::path MacOSXApplicationPathProvider::getDataDir() const { boost::filesystem::path result(getHomeDir() / "Library/Application Support" / getApplicationName().getUTF8String()); try { boost::filesystem::create_directory(result); diff --git a/Swiften/Application/MacOSXApplicationPathProvider.h b/Swiften/Application/MacOSXApplicationPathProvider.h index 72cfb38..85cca0a 100644 --- a/Swiften/Application/MacOSXApplicationPathProvider.h +++ b/Swiften/Application/MacOSXApplicationPathProvider.h @@ -14,7 +14,7 @@ namespace Swift { MacOSXApplicationPathProvider(const String& name); virtual boost::filesystem::path getHomeDir() const; - boost::filesystem::path getSettingsDir() const; + boost::filesystem::path getDataDir() const; virtual boost::filesystem::path getExecutableDir() const; virtual std::vector<boost::filesystem::path> getResourceDirs() const { diff --git a/Swiften/Application/UnitTest/ApplicationPathProviderTest.cpp b/Swiften/Application/UnitTest/ApplicationPathProviderTest.cpp index 75b8639..3b46e6e 100644 --- a/Swiften/Application/UnitTest/ApplicationPathProviderTest.cpp +++ b/Swiften/Application/UnitTest/ApplicationPathProviderTest.cpp @@ -14,7 +14,7 @@ using namespace Swift; class ApplicationPathProviderTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(ApplicationPathProviderTest); - CPPUNIT_TEST(testGetSettingsDir); + CPPUNIT_TEST(testGetDataDir); CPPUNIT_TEST(testGetExecutableDir); CPPUNIT_TEST_SUITE_END(); @@ -27,8 +27,8 @@ class ApplicationPathProviderTest : public CppUnit::TestFixture { delete testling_; } - void testGetSettingsDir() { - boost::filesystem::path dir = testling_->getSettingsDir(); + void testGetDataDir() { + boost::filesystem::path dir = testling_->getDataDir(); CPPUNIT_ASSERT(boost::filesystem::exists(dir)); CPPUNIT_ASSERT(boost::filesystem::is_directory(dir)); diff --git a/Swiften/Application/UnixApplicationPathProvider.h b/Swiften/Application/UnixApplicationPathProvider.h index 047261e..5dd5aa5 100644 --- a/Swiften/Application/UnixApplicationPathProvider.h +++ b/Swiften/Application/UnixApplicationPathProvider.h @@ -37,7 +37,7 @@ namespace Swift { return boost::filesystem::path(getenv("HOME")); } - boost::filesystem::path getSettingsDir() const { + boost::filesystem::path getDataDir() const { boost::filesystem::path result(getHomeDir() / ("." + getApplicationName().getLowerCase().getUTF8String())); try { boost::filesystem::create_directory(result); diff --git a/Swiften/Application/WindowsApplicationPathProvider.h b/Swiften/Application/WindowsApplicationPathProvider.h index 1879300..a026dba 100644 --- a/Swiften/Application/WindowsApplicationPathProvider.h +++ b/Swiften/Application/WindowsApplicationPathProvider.h @@ -13,7 +13,7 @@ namespace Swift { public: WindowsApplicationPathProvider(const String& name); - boost::filesystem::path getSettingsDir() const { + boost::filesystem::path getDataDir() const { char* appDirRaw = getenv("APPDATA"); boost::filesystem::path result(boost::filesystem::path(appDirRaw) / getApplicationName().getUTF8String()); boost::filesystem::create_directory(result); |