pidgin/gtkutils.c

changeset 32036
4377067bda01
parent 31889
96183796df0c
child 32043
73c3b1db2364
child 32149
b9712ee01305
equal deleted inserted replaced
32035:f3fa240fea6c 32036:4377067bda01
3280 { 3280 {
3281 /* Copied from gtkft.c:open_button_cb */ 3281 /* Copied from gtkft.c:open_button_cb */
3282 #ifdef _WIN32 3282 #ifdef _WIN32
3283 /* If using Win32... */ 3283 /* If using Win32... */
3284 int code; 3284 int code;
3285 wchar_t *wc_filename = g_utf8_to_utf16( 3285 if (purple_str_has_prefix(uri, "file://"))
3286 uri, -1, NULL, NULL, NULL); 3286 {
3287 3287 gchar *escaped = g_shell_quote(uri);
3288 code = (int)ShellExecuteW(NULL, NULL, wc_filename, NULL, NULL, 3288 gchar *param = g_strconcat("/select,\"", uri, "\"", NULL);
3289 SW_SHOW); 3289 gchar *wc_param = g_utf8_to_utf16(param, -1, NULL, NULL, NULL);
3290 3290
3291 g_free(wc_filename); 3291 code = (int)ShellExecuteW(NULL, "OPEN", L"explorer.exe", wc_param, NULL, SW_NORMAL);
3292
3293 g_free(wc_param);
3294 g_free(param);
3295 g_free(escaped);
3296 } else {
3297 wchar_t *wc_filename = g_utf8_to_utf16(
3298 uri, -1, NULL, NULL, NULL);
3299
3300 code = (int)ShellExecuteW(NULL, NULL, wc_filename, NULL, NULL,
3301 SW_SHOW);
3302
3303 g_free(wc_filename);
3304 }
3292 3305
3293 if (code == SE_ERR_ASSOCINCOMPLETE || code == SE_ERR_NOASSOC) 3306 if (code == SE_ERR_ASSOCINCOMPLETE || code == SE_ERR_NOASSOC)
3294 { 3307 {
3295 purple_notify_error(imhtml, NULL, 3308 purple_notify_error(imhtml, NULL,
3296 _("There is no application configured to open this type of file."), NULL); 3309 _("There is no application configured to open this type of file."), NULL);

mercurial