diff options
| author | Alexander Valavanis <valavanisalex@gmail.com> | 2017-07-10 08:19:49 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2017-07-10 08:19:49 +0000 |
| commit | 9bb10ed9ea07d21c926f3ab1ca5db8027be29378 (patch) | |
| tree | ce610e17ab62bb84f01bbb4d8cef50fed685382a /src/io/resource.cpp | |
| parent | Update popup menu usage (diff) | |
| parent | Shortcuts: Fix for 7d248fbba5b0c24d9a24cda8c3f2e79f96395553 (is_user_set was ... (diff) | |
| download | inkscape-9bb10ed9ea07d21c926f3ab1ca5db8027be29378.tar.gz inkscape-9bb10ed9ea07d21c926f3ab1ca5db8027be29378.zip | |
Merge branch 'master' of gitlab.com:inkscape/inkscape
Diffstat (limited to 'src/io/resource.cpp')
| -rw-r--r-- | src/io/resource.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/io/resource.cpp b/src/io/resource.cpp index 7ecfceb81..dfb851d58 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,12 +275,13 @@ 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 migrate 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 ) { + if ( SHGetFolderLocation( NULL, CSIDL_APPDATA, NULL, 0, &pidl ) == S_OK ) { gchar * utf8Path = NULL; { |
