summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-07-04 11:11:21 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-07-04 11:11:21 (GMT)
commit5f006623bf624423a57ed5fbae2b8b1e90e4a66e (patch)
tree073875e3950750a77821978c7677551d8718e8de /Swiften
parent640b4c48d828c9f7b839e0cd6003cc7ccdea9575 (diff)
downloadswift-contrib-5f006623bf624423a57ed5fbae2b8b1e90e4a66e.zip
swift-contrib-5f006623bf624423a57ed5fbae2b8b1e90e4a66e.tar.bz2
Commit workaround for Windows not having %HOME%.
Remko to review, please.
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Application/Application.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Swiften/Application/Application.cpp b/Swiften/Application/Application.cpp
index 6ffb46f..e5c925a 100644
--- a/Swiften/Application/Application.cpp
+++ b/Swiften/Application/Application.cpp
@@ -23,7 +23,14 @@ boost::filesystem::path Application::getAvatarDir() const {
boost::filesystem::path Application::getHomeDir() const {
// FIXME: Does this work on windows?
+ // No it doesn't, putting alternative paths in for the moment.
char* homeDirRaw = getenv("HOME");
+ if (!homeDirRaw) {
+ homeDirRaw = getenv("APPDATA");
+ }
+ if (!homeDirRaw) {
+ homeDirRaw = getenv("USERPROFILE");
+ }
boost::filesystem::path homeDir(homeDirRaw);
return homeDir;
}