[Xfce4-commits] <midori:master> Switch to already open tab of external URI if possible
Christian Dywan
noreply at xfce.org
Thu Sep 22 00:30:01 CEST 2011
Updating branch refs/heads/master
to a49c6e8ad75b9ce3d87dffda948a86d5e78eebcc (commit)
from 648d869e4ff69f121da97484a0fd553b005ca751 (commit)
commit a49c6e8ad75b9ce3d87dffda948a86d5e78eebcc
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu Sep 22 00:26:49 2011 +0200
Switch to already open tab of external URI if possible
midori/midori-app.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/midori/midori-app.c b/midori/midori-app.c
index bb9b5b6..26b81ce 100644
--- a/midori/midori-app.c
+++ b/midori/midori-app.c
@@ -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++;
More information about the Xfce4-commits
mailing list