summaryrefslogtreecommitdiffstats
path: root/src/io
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-07-08 16:21:32 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-07-08 16:21:32 +0000
commitef507c3c654d59575e8928e0a225c433bbe79aa7 (patch)
treeef7d51a5796e72073738da0ef17033ad11a3cf75 /src/io
parentcmake: fix inkscape-version for linked worktrees (diff)
downloadinkscape-ef507c3c654d59575e8928e0a225c433bbe79aa7.tar.gz
inkscape-ef507c3c654d59575e8928e0a225c433bbe79aa7.zip
Hackfest Regression: Fix profile_path() not returning the correct directory
Also drop some unnecessary defines from the pre-XP era
Diffstat (limited to 'src/io')
-rw-r--r--src/io/resource.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/io/resource.cpp b/src/io/resource.cpp
index 7ecfceb81..4610efd46 100644
--- a/src/io/resource.cpp
+++ b/src/io/resource.cpp
@@ -20,6 +20,10 @@
#include "config.h"
#endif
+#ifdef WIN32
+#include <shlobj.h> // for SHGetSpecialFolderLocation
+#endif
+
#include <glibmm/miscutils.h>
#include <glibmm/stringutils.h>
#include <glibmm/fileutils.h>
@@ -271,9 +275,10 @@ char *profile_path(const char *filename)
prefdir = g_strdup(userenv);
}
-#ifdef HAS_SHGetSpecialFolderLocation
- // prefer c:\Documents and Settings\UserName\Application Data\ to
- // c:\Documents and Settings\userName\;
+#ifdef WIN32
+ // prefer c:\Documents and Settings\UserName\Application Data\ to c:\Documents and Settings\userName\;
+ // TODO: CSIDL_APPDATA is C:\Users\UserName\AppData\Roaming these days
+ // should we switch to AppData\Local? Then we can simply use the portable g_get_user_config_dir()
if (!prefdir) {
ITEMIDLIST *pidl = 0;
if ( SHGetSpecialFolderLocation( NULL, CSIDL_APPDATA, &pidl ) == NOERROR ) {