Switch to already open tab of external URI if possible
This commit is contained in:
parent
648d869e4f
commit
a49c6e8ad7
1 changed files with 19 additions and 2 deletions
|
@ -500,8 +500,25 @@ midori_app_command_received (MidoriApp* app,
|
|||
first = FALSE;
|
||||
}
|
||||
else
|
||||
midori_browser_set_current_page (browser,
|
||||
midori_browser_add_uri (browser, fixed_uri));
|
||||
{
|
||||
/* Switch to already open tab if possible */
|
||||
guint i = 0;
|
||||
GtkWidget* tab;
|
||||
gboolean found = FALSE;
|
||||
while ((tab = midori_browser_get_nth_tab (browser, i++)))
|
||||
if (g_str_equal (
|
||||
midori_view_get_display_uri (MIDORI_VIEW (tab)),
|
||||
fixed_uri))
|
||||
{
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
if (found)
|
||||
midori_browser_set_current_tab (browser, tab);
|
||||
else
|
||||
midori_browser_set_current_page (browser,
|
||||
midori_browser_add_uri (browser, fixed_uri));
|
||||
}
|
||||
}
|
||||
g_free (fixed_uri);
|
||||
uris++;
|
||||
|
|
Loading…
Reference in a new issue