[gitg/gtk3: 2/20] Don't set a GtkLinkButton uri hook



commit 0c279704cfdf0e38603a248c9d872f36e1f38e85
Author: Garrett Regier <alias301 gmail com>
Date:   Sun Jan 2 20:27:15 2011 -0800

    Don't set a GtkLinkButton uri hook
    
    We don't have any GtkLinkButtons so its just pointless.

 gitg/gitg.c |   56 --------------------------------------------------------
 1 files changed, 0 insertions(+), 56 deletions(-)
---
diff --git a/gitg/gitg.c b/gitg/gitg.c
index e2676f4..2372a10 100644
--- a/gitg/gitg.c
+++ b/gitg/gitg.c
@@ -37,7 +37,6 @@
 
 static gboolean commit_mode = FALSE;
 static gchar *select_sha1 = NULL;
-static GtkLinkButtonUriFunc original_link_button_hook;
 
 static void
 show_version_and_quit (void)
@@ -167,57 +166,6 @@ set_icons ()
 	g_list_free (icons);
 }
 
-static void
-link_button_uri_hook (GtkLinkButton *button,
-                      gchar const   *link_,
-                      GitgWindow    *window)
-{
-	GFile *file;
-	GitgRepository *repository;
-
-	file = g_file_new_for_uri (link_);
-	repository = gitg_window_get_repository (window);
-
-	if (!g_file_has_uri_scheme (file, "gitg"))
-	{
-		original_link_button_hook (button, link_, NULL);
-	}
-	else if (repository)
-	{
-		gchar *work_tree_path;
-		gchar *selection;
-		gchar *activatable;
-		gchar *action;
-
-		if (gitg_uri_parse (link_, &work_tree_path, &selection, &activatable, &action))
-		{
-			GFile *wt;
-			GFile *work_tree;
-			gboolean equal;
-
-			wt = gitg_repository_get_work_tree (repository);
-			work_tree = g_file_new_for_path (work_tree_path);
-			equal = g_file_equal (wt, work_tree);
-
-			g_object_unref (wt);
-			g_object_unref (work_tree);
-
-			if (equal)
-			{
-				gitg_window_select (window, selection);
-				gitg_window_activate (window, activatable, action);
-			}
-
-			g_free (work_tree_path);
-			g_free (selection);
-			g_free (activatable);
-			g_free (action);
-		}
-	}
-
-	g_object_unref (file);
-}
-
 int
 main (int argc, char **argv)
 {
@@ -256,10 +204,6 @@ main (int argc, char **argv)
 		gitg_window_show_commit (window);
 	}
 
-	original_link_button_hook = gtk_link_button_set_uri_hook ((GtkLinkButtonUriFunc)link_button_uri_hook,
-	                                                          window,
-	                                                          NULL);
-
 	gtk_main ();
 
 	return 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]