diff options
author | Paweł Forysiuk tuxator@o2.pl <> | 2015-12-29 22:41:07 +0100 |
---|---|---|
committer | Paweł Forysiuk tuxator@o2.pl <> | 2015-12-29 22:41:07 +0100 |
commit | 952eb1ac11b248da4cc4df0cc82e9966fb2711a3 (patch) | |
tree | c73f70d2f3e9a255942454dadc8e04f0857d69a9 /midori | |
parent | 266aef85ab9f153d27bdd1d687e1882347854617 (diff) | |
download | midori-952eb1ac11b248da4cc4df0cc82e9966fb2711a3.tar.gz |
Add helper function for getting current APPDATA directory
Diffstat (limited to 'midori')
-rw-r--r-- | midori/sokoke.c | 14 | ||||
-rw-r--r-- | midori/sokoke.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/midori/sokoke.c b/midori/sokoke.c index 2e316558..7db1517e 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -919,6 +919,20 @@ sokoke_search_entry_new (const gchar* placeholder_text) } #ifdef G_OS_WIN32 +const gchar* +sokoke_get_win32_appdata_dir() +{ + WCHAR path[MAX_PATH]; + gchar* appdata_dir = NULL; + + SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, path); + + MultiByteToWideChar (CP_UTF8, 0, appdata_dir, -1, path, MAX_PATH); + + return g_strdup(path); +} + + gchar* sokoke_get_win32_desktop_lnk_path_for_filename (gchar* filename) { diff --git a/midori/sokoke.h b/midori/sokoke.h index bbce8454..8322e3f2 100644 --- a/midori/sokoke.h +++ b/midori/sokoke.h @@ -109,6 +109,9 @@ GtkWidget* sokoke_search_entry_new (const gchar* placeholder_text); #ifdef G_OS_WIN32 +const gchar* +sokoke_get_win32_appdata_dir(); + gchar* sokoke_get_win32_desktop_lnk_path_for_filename (gchar* filename); |