1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:59:54 +00:00

Removing the unnecessary local variables

This commit is contained in:
Alexander "Ace" Olofsson 2012-09-08 20:34:43 +02:00
parent 97f1be2b05
commit cd3e780614
3 changed files with 6 additions and 19 deletions

View file

@ -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

View file

@ -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

View file

@ -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