Remove the "existing window" option for where to open URLs.

Fri, 06 Dec 2013 01:06:45 -0800

author
Mark Doliner <mark@kingant.net>
date
Fri, 06 Dec 2013 01:06:45 -0800
changeset 35105
ed127ccd9b9f
parent 35104
512fcfb0bda3
child 35106
79ebfc0d91df
child 36963
6cc39a95f75b

Remove the "existing window" option for where to open URLs.

This was kind of a dumb option. I mean, who would want that?
We didn't support it in Chrome. We attempted to support it in
Firefox, Netscape and Opera.

It actually caused my Pidgin to hang when I tested it with Firefox.
I'm sure it's fixable, but who cares? Here's the stacktrace, for the
curious:
#0 0x00007f5c461a8fbd in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007f5c470be1dc in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007f5c470be6ba in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007f5c470ffe41 in g_spawn_sync () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007f5c471002b8 in g_spawn_command_line_sync () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00000000004ae804 in uri_command (command=0x203e760 "firefox -a firefox -remote openURL('http://www.yahoo.com/')",
sync=1) at gtknotify.c:1270

pidgin/gtknotify.c file | annotate | diff | comparison | revisions
pidgin/gtkprefs.c file | annotate | diff | comparison | revisions
pidgin/gtkutils.h file | annotate | diff | comparison | revisions
--- a/pidgin/gtknotify.c	Fri Dec 06 00:43:06 2013 -0800
+++ b/pidgin/gtknotify.c	Fri Dec 06 01:06:45 2013 -0800
@@ -1376,10 +1376,6 @@
 			remote_command = g_strdup_printf("%s %s -remote "
 											 "openURL(%s,new-tab)",
 											 web_browser, args, escaped);
-		else if (place == PIDGIN_BROWSER_CURRENT)
-			remote_command = g_strdup_printf("%s %s -remote "
-											 "openURL(%s)",
-											 web_browser, args, escaped);
 	}
 	else if (!strcmp(web_browser, "netscape"))
 	{
@@ -1391,11 +1387,6 @@
 											 "openURL(%s,new-window)",
 											 escaped);
 		}
-		else if (place == PIDGIN_BROWSER_CURRENT)
-		{
-			remote_command = g_strdup_printf("netscape -remote "
-											 "openURL(%s)", escaped);
-		}
 	}
 	else if (!strcmp(web_browser, "opera"))
 	{
@@ -1403,12 +1394,6 @@
 			command = g_strdup_printf("opera -newwindow %s", escaped);
 		else if (place == PIDGIN_BROWSER_NEW_TAB)
 			command = g_strdup_printf("opera -newpage %s", escaped);
-		else if (place == PIDGIN_BROWSER_CURRENT)
-		{
-			remote_command = g_strdup_printf("opera -remote "
-											 "openURL(%s)", escaped);
-			command = g_strdup_printf("opera %s", escaped);
-		}
 		else
 			command = g_strdup_printf("opera %s", escaped);
 
--- a/pidgin/gtkprefs.c	Fri Dec 06 00:43:06 2013 -0800
+++ b/pidgin/gtkprefs.c	Fri Dec 06 01:06:45 2013 -0800
@@ -2434,7 +2434,6 @@
 			label = pidgin_prefs_dropdown(hbox, _("_Open link in:"), PURPLE_PREF_INT,
 				PIDGIN_PREFS_ROOT "/browsers/place",
 				_("Browser default"), PIDGIN_BROWSER_DEFAULT,
-				_("Existing window"), PIDGIN_BROWSER_CURRENT,
 				_("New window"), PIDGIN_BROWSER_NEW_WINDOW,
 				_("New tab"), PIDGIN_BROWSER_NEW_TAB,
 				NULL);
@@ -4408,5 +4407,15 @@
 
 	purple_prefs_remove("/plugins/core/vvconfig");
 	purple_prefs_remove("/plugins/gtk/vvconfig");
+
+#ifndef _WIN32
+	/* Added in 3.0.0. */
+	if (purple_prefs_get_int(PIDGIN_PREFS_ROOT "/browsers/place") == 1) {
+		/* If the "open link in" pref is set to the old value for "existing
+		   window" then change it to "default." */
+		purple_prefs_set_int(PIDGIN_PREFS_ROOT "/browsers/place",
+				PIDGIN_BROWSER_DEFAULT);
+	}
+#endif /* !_WIN32 */
 }
 
--- a/pidgin/gtkutils.h	Fri Dec 06 00:43:06 2013 -0800
+++ b/pidgin/gtkutils.h	Fri Dec 06 01:06:45 2013 -0800
@@ -58,8 +58,8 @@
 typedef enum
 {
 	PIDGIN_BROWSER_DEFAULT = 0,
-	PIDGIN_BROWSER_CURRENT,
-	PIDGIN_BROWSER_NEW_WINDOW,
+	/* value '1' was used by PIDGIN_BROWSER_CURRENT, which no longer exists */
+	PIDGIN_BROWSER_NEW_WINDOW = 2,
 	PIDGIN_BROWSER_NEW_TAB
 
 } PidginBrowserPlace;

mercurial