From cd3e780614e4cd595997c8ecc1a5900ecc70ef13 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Sat, 8 Sep 2012 20:34:43 +0200 Subject: [PATCH] Removing the unnecessary local variables --- components/files/linuxpath.cpp | 10 +++------- components/files/macospath.cpp | 5 +---- components/files/windowspath.cpp | 10 ++-------- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/components/files/linuxpath.cpp b/components/files/linuxpath.cpp index 0746350c8..1716757c6 100644 --- a/components/files/linuxpath.cpp +++ b/components/files/linuxpath.cpp @@ -44,7 +44,6 @@ LinuxPath::LinuxPath(const std::string& application_name) boost::filesystem::path LinuxPath::getUserPath() const { boost::filesystem::path userPath("."); - boost::filesystem::path suffix(mName); const char* theDir = getenv("HOME"); if (theDir == NULL) @@ -62,15 +61,12 @@ boost::filesystem::path LinuxPath::getUserPath() const userPath = boost::filesystem::path(theDir); } - userPath /= suffix; - - return userPath; + return userPath / mName; } boost::filesystem::path LinuxPath::getCachePath() const { boost::filesystem::path userPath("."); - boost::filesystem::path suffix(mName); const char* theDir = getenv("HOME"); if (theDir == NULL) @@ -86,9 +82,9 @@ boost::filesystem::path LinuxPath::getCachePath() const { userPath = boost::filesystem::path(theDir); } - userPath /= ".cache" / suffix; + userPath /= ".cache"; - return userPath; + return userPath / mName; } boost::filesystem::path LinuxPath::getGlobalPath() const diff --git a/components/files/macospath.cpp b/components/files/macospath.cpp index d9ebb2e2d..9625612ad 100644 --- a/components/files/macospath.cpp +++ b/components/files/macospath.cpp @@ -47,7 +47,6 @@ MacOsPath::MacOsPath(const std::string& application_name) boost::filesystem::path MacOsPath::getUserPath() const { boost::filesystem::path userPath("."); - boost::filesystem::path suffix(mName); const char* theDir = getenv("HOME"); if (theDir == NULL) @@ -63,9 +62,7 @@ boost::filesystem::path MacOsPath::getUserPath() const userPath = boost::filesystem::path(theDir) / "Library/Preferences/"; } - userPath /= suffix; - - return userPath; + return userPath / mName; } boost::filesystem::path MacOsPath::getGlobalPath() const diff --git a/components/files/windowspath.cpp b/components/files/windowspath.cpp index dffe3410f..e8f1a2b08 100644 --- a/components/files/windowspath.cpp +++ b/components/files/windowspath.cpp @@ -28,7 +28,6 @@ WindowsPath::WindowsPath(const std::string& application_name) boost::filesystem::path WindowsPath::getUserPath() const { boost::filesystem::path userPath("."); - boost::filesystem::path suffix(mName); TCHAR path[MAX_PATH]; memset(path, 0, sizeof(path)); @@ -39,15 +38,12 @@ boost::filesystem::path WindowsPath::getUserPath() const userPath = boost::filesystem::path(path); } - userPath /= suffix; - - return userPath; + return userPath / mName; } boost::filesystem::path WindowsPath::getGlobalPath() const { boost::filesystem::path globalPath("."); - boost::filesystem::path suffix(mName); TCHAR path[MAX_PATH]; memset(path, 0, sizeof(path)); @@ -57,9 +53,7 @@ boost::filesystem::path WindowsPath::getGlobalPath() const globalPath = boost::filesystem::path(path); } - globalPath /= suffix; - - return globalPath; + return globalPath / mName; } boost::filesystem::path WindowsPath::getLocalPath() const