[gedit] Get the current tab label instead of creating a new one.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Get the current tab label instead of creating a new one.
- Date: Sun, 3 Oct 2010 11:55:25 +0000 (UTC)
commit 526913576a9e07beab4858ca39c58ea872eca8bf
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sun Oct 3 13:54:49 2010 +0200
Get the current tab label instead of creating a new one.
gedit/gedit-notebook.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gedit/gedit-notebook.c b/gedit/gedit-notebook.c
index d8517ce..b3680a1 100644
--- a/gedit/gedit-notebook.c
+++ b/gedit/gedit-notebook.c
@@ -900,13 +900,24 @@ create_tab_label (GeditNotebook *nb,
return tab_label;
}
+static GtkWidget *
+get_tab_label (GeditTab *tab)
+{
+ GtkWidget *tab_label;
+
+ tab_label = GTK_WIDGET (g_object_get_data (G_OBJECT (tab), "tab-label"));
+ g_return_val_if_fail (tab_label != NULL, NULL);
+
+ return tab_label;
+}
+
static void
remove_tab_label (GeditNotebook *nb,
GeditTab *tab)
{
GtkWidget *tab_label;
- tab_label = gedit_tab_label_new (tab);
+ tab_label = get_tab_label (tab);
g_signal_handlers_disconnect_by_func (tab_label,
G_CALLBACK (close_button_clicked_cb),
@@ -915,17 +926,6 @@ remove_tab_label (GeditNotebook *nb,
g_object_set_data (G_OBJECT (tab), "tab-label", NULL);
}
-static GtkWidget *
-get_tab_label (GeditTab *tab)
-{
- GtkWidget *tab_label;
-
- tab_label = GTK_WIDGET (g_object_get_data (G_OBJECT (tab), "tab-label"));
- g_return_val_if_fail (tab_label != NULL, NULL);
-
- return tab_label;
-}
-
/**
* gedit_notebook_add_tab:
* @nb: a #GeditNotebook
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]