From 5f006623bf624423a57ed5fbae2b8b1e90e4a66e Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Sat, 4 Jul 2009 12:11:21 +0100 Subject: Commit workaround for Windows not having %HOME%. Remko to review, please. 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; } -- cgit v0.10.2-6-g49f6