pidgin: 633db1f2: Make the "Execute a command" buddy pounc...

datallah at pidgin.im datallah at pidgin.im
Sun Feb 14 02:01:29 EST 2010


-----------------------------------------------------------------
Revision: 633db1f2c83f666e4ac7a26601725cb01233681e
Ancestor: b858ae8085cda451692ceda2c63265a69c2d4a6f
Author: datallah at pidgin.im
Date: 2010-02-14T06:57:53
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/633db1f2c83f666e4ac7a26601725cb01233681e

Modified files:
        pidgin/gtkpounce.c pidgin/win32/gtkwin32dep.c

ChangeLog: 

Make the "Execute a command" buddy pounce action use ShellExecute() on Windows so that it can open files of all types (e.g. MP3s) with their default associated application.  Fixes #11333.

-------------- next part --------------
============================================================
--- pidgin/gtkpounce.c	1c44786faf254e353849c616aa9efd2bc7acc468
+++ pidgin/gtkpounce.c	1e41a060a215ebe9ce0425f49d39d9863610d675
@@ -1546,53 +1546,7 @@ pounce_cb(PurplePounce *pounce, PurplePo
 				g_free(localecmd);
 			}
 #else /* !_WIN32 */
-			PROCESS_INFORMATION pi;
-			BOOL retval;
-			gchar *message = NULL;
-
-			memset(&pi, 0, sizeof(pi));
-
-			if (G_WIN32_HAVE_WIDECHAR_API ()) {
-				STARTUPINFOW si;
-				wchar_t *wc_cmd = g_utf8_to_utf16(command,
-						-1, NULL, NULL, NULL);
-
-				memset(&si, 0 , sizeof(si));
-				si.cb = sizeof(si);
-
-				retval = CreateProcessW(NULL, wc_cmd, NULL,
-						NULL, 0, 0, NULL, NULL,
-						&si, &pi);
-				g_free(wc_cmd);
-			} else {
-				STARTUPINFOA si;
-				char *l_cmd = g_locale_from_utf8(command,
-						-1, NULL, NULL, NULL);
-
-				memset(&si, 0 , sizeof(si));
-				si.cb = sizeof(si);
-
-				retval = CreateProcessA(NULL, l_cmd, NULL,
-						NULL, 0, 0, NULL, NULL,
-						&si, &pi);
-				g_free(l_cmd);
-			}
-
-			if (retval) {
-				CloseHandle(pi.hProcess);
-				CloseHandle(pi.hThread);
-			} else {
-				message = g_win32_error_message(GetLastError());
-			}
-
-			purple_debug_info("pounce",
-					"Pounce execute command called for: "
-					"%s\n%s%s%s",
-						command,
-						retval ? "" : "Error: ",
-						retval ? "" : message,
-						retval ? "" : "\n");
-			g_free(message);
+			winpidgin_shell_execute(command, "open", NULL);
 #endif /* !_WIN32 */
 		}
 	}
============================================================
--- pidgin/win32/gtkwin32dep.c	55a8531d83b87d00ef47820e831f8fdaa266a7a4
+++ pidgin/win32/gtkwin32dep.c	3aa86270be5a0b4a1ede543085889c7cabdcf380
@@ -157,6 +157,7 @@ void winpidgin_shell_execute(const char 
 		wsinfo.lpVerb = w_verb;
 		wsinfo.lpFile = w_uri;
 		wsinfo.nShow = SW_SHOWNORMAL;
+		wsinfo.fMask |= SEE_MASK_FLAG_NO_UI;
 		if (clazz != NULL) {
 			w_clazz = g_utf8_to_utf16(clazz, -1, NULL, NULL, NULL);
 			wsinfo.fMask |= SEE_MASK_CLASSNAME;
@@ -181,6 +182,7 @@ void winpidgin_shell_execute(const char 
 		sinfo.lpVerb = verb;
 		sinfo.lpFile = locale_uri;
 		sinfo.nShow = SW_SHOWNORMAL;
+		sinfo.fMask |= SEE_MASK_FLAG_NO_UI;
 		if (clazz != NULL) {
 			sinfo.fMask |= SEE_MASK_CLASSNAME;
 			sinfo.lpClass = clazz;


More information about the Commits mailing list