Use glib to get portable mode dir

This should fix any non-ascii paths
This commit is contained in:
TingPing 2014-08-23 12:45:02 -04:00 committed by TingPing
parent f07be8f0a6
commit 04d2329fed

View File

@ -313,13 +313,10 @@ get_xdir (void)
if (portable_mode () || SHGetKnownFolderPath (&FOLDERID_RoamingAppData, 0, NULL, &roaming_path_wide) != S_OK) if (portable_mode () || SHGetKnownFolderPath (&FOLDERID_RoamingAppData, 0, NULL, &roaming_path_wide) != S_OK)
{ {
char *path; char *path;
char file[MAX_PATH];
HMODULE hModule;
hModule = GetModuleHandle (NULL); path = g_win32_get_package_installation_directory_of_module (NULL);
if (GetModuleFileName (hModule, file, sizeof(file))) if (path)
{ {
path = g_path_get_dirname (file);
xdir = g_build_filename (path, "config", NULL); xdir = g_build_filename (path, "config", NULL);
g_free (path); g_free (path);
} }