From ef507c3c654d59575e8928e0a225c433bbe79aa7 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 8 Jul 2017 18:21:32 +0200 Subject: Hackfest Regression: Fix profile_path() not returning the correct directory Also drop some unnecessary defines from the pre-XP era --- src/inkscape.cpp | 14 -------------- src/io/resource.cpp | 11 ++++++++--- 2 files changed, 8 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 22f7230a0..24a744bbd 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -30,20 +30,6 @@ #include "debug/simple-event.h" #include "debug/event-tracker.h" -#ifndef WIN32 -# define HAS_PROC_SELF_EXE //to get path of executable -#else - -#if !defined(_WIN32_IE) || (_WIN32_IE < 0x0400) -# undef _WIN32_IE -# define _WIN32_IE 0x0400 -#endif -//#define HAS_SHGetSpecialFolderPath -#define HAS_SHGetSpecialFolderLocation -#define HAS_GetModuleFileName -# include -#endif - #include #include #include 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 // for SHGetSpecialFolderLocation +#endif + #include #include #include @@ -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 ) { -- cgit v1.2.3