[gedit] notebook: remove dead code



commit fa76866bab3914e1baec88e6234b10ca16ad2917
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Jun 10 11:41:59 2015 +0200

    notebook: remove dead code

 gedit/gedit-notebook.c |   73 +-----------------------------------------------
 gedit/gedit-notebook.h |   32 ++------------------
 2 files changed, 5 insertions(+), 100 deletions(-)
---
diff --git a/gedit/gedit-notebook.c b/gedit/gedit-notebook.c
index 6e0a71d..039f638 100644
--- a/gedit/gedit-notebook.c
+++ b/gedit/gedit-notebook.c
@@ -27,34 +27,21 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include "gedit-notebook.h"
-
-#include <glib-object.h>
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-
-#include "gedit-tab.h"
 #include "gedit-tab-label.h"
-#include "gedit-window.h"
 #include "gedit-marshal.h"
 
 #define GEDIT_NOTEBOOK_GROUP_NAME "GeditNotebookGroup"
 
 struct _GeditNotebookPrivate
 {
-       GList         *focused_pages;
+       GList *focused_pages;
 
-       guint close_buttons_sensitive : 1;
        guint ignore_focused_page_update : 1;
 };
 
 G_DEFINE_TYPE_WITH_PRIVATE (GeditNotebook, gedit_notebook, GTK_TYPE_NOTEBOOK)
 
-/* Signals */
 enum
 {
        TAB_CLOSE_REQUEST,
@@ -467,12 +454,7 @@ gedit_notebook_new (void)
 static void
 gedit_notebook_init (GeditNotebook *notebook)
 {
-       GeditNotebookPrivate *priv;
-
        notebook->priv = gedit_notebook_get_instance_private (notebook);
-       priv = notebook->priv;
-
-       priv->close_buttons_sensitive = TRUE;
 
        gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
        gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
@@ -600,57 +582,4 @@ gedit_notebook_remove_all_tabs (GeditNotebook *nb)
        g_list_free (tabs);
 }
 
-static void
-set_close_buttons_sensitivity (GeditTab      *tab,
-                               GeditNotebook *nb)
-{
-       GtkWidget *tab_label;
-
-       tab_label = get_tab_label (tab);
-
-       gedit_tab_label_set_close_button_sensitive (GEDIT_TAB_LABEL (tab_label),
-                                                   nb->priv->close_buttons_sensitive);
-}
-
-/**
- * gedit_notebook_set_close_buttons_sensitive:
- * @nb: a #GeditNotebook
- * @sensitive: %TRUE to make the buttons sensitive
- *
- * Sets whether the close buttons in the tabs of @nb are sensitive.
- */
-void
-gedit_notebook_set_close_buttons_sensitive (GeditNotebook *nb,
-                                           gboolean       sensitive)
-{
-       g_return_if_fail (GEDIT_IS_NOTEBOOK (nb));
-
-       sensitive = (sensitive != FALSE);
-
-       if (sensitive == nb->priv->close_buttons_sensitive)
-               return;
-
-       nb->priv->close_buttons_sensitive = sensitive;
-
-       gtk_container_foreach (GTK_CONTAINER (nb),
-                              (GtkCallback)set_close_buttons_sensitivity,
-                              nb);
-}
-
-/**
- * gedit_notebook_get_close_buttons_sensitive:
- * @nb: a #GeditNotebook
- *
- * Whether the close buttons are sensitive.
- *
- * Returns: %TRUE if the close buttons are sensitive
- */
-gboolean
-gedit_notebook_get_close_buttons_sensitive (GeditNotebook *nb)
-{
-       g_return_val_if_fail (GEDIT_IS_NOTEBOOK (nb), TRUE);
-
-       return nb->priv->close_buttons_sensitive;
-}
-
 /* ex:set ts=8 noet: */
diff --git a/gedit/gedit-notebook.h b/gedit/gedit-notebook.h
index 46416f1..e4a3e6b 100644
--- a/gedit/gedit-notebook.h
+++ b/gedit/gedit-notebook.h
@@ -31,15 +31,10 @@
 #define GEDIT_NOTEBOOK_H
 
 #include <gedit/gedit-tab.h>
-
-#include <glib.h>
 #include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
-/*
- * Type checking and casting macros
- */
 #define GEDIT_TYPE_NOTEBOOK            (gedit_notebook_get_type ())
 #define GEDIT_NOTEBOOK(o)              (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_NOTEBOOK, GeditNotebook))
 #define GEDIT_NOTEBOOK_CLASS(k)                (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_NOTEBOOK, 
GeditNotebookClass))
@@ -47,6 +42,10 @@ G_BEGIN_DECLS
 #define GEDIT_IS_NOTEBOOK_CLASS(k)     (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_NOTEBOOK))
 #define GEDIT_NOTEBOOK_GET_CLASS(o)    (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_NOTEBOOK, 
GeditNotebookClass))
 
+typedef struct _GeditNotebook          GeditNotebook;
+typedef struct _GeditNotebookClass     GeditNotebookClass;
+typedef struct _GeditNotebookPrivate   GeditNotebookPrivate;
+
 /* This is now used in multi-notebook but we keep the same enum for
  * backward compatibility since it is used in the gsettings schema */
 typedef enum
@@ -56,14 +55,6 @@ typedef enum
        GEDIT_NOTEBOOK_SHOW_TABS_ALWAYS
 } GeditNotebookShowTabsModeType;
 
-/* Private structure type */
-typedef struct _GeditNotebookPrivate   GeditNotebookPrivate;
-
-/*
- * Main object structure
- */
-typedef struct _GeditNotebook          GeditNotebook;
-
 struct _GeditNotebook
 {
        GtkNotebook notebook;
@@ -72,11 +63,6 @@ struct _GeditNotebook
        GeditNotebookPrivate *priv;
 };
 
-/*
- * Class definition
- */
-typedef struct _GeditNotebookClass     GeditNotebookClass;
-
 struct _GeditNotebookClass
 {
        GtkNotebookClass parent_class;
@@ -91,9 +77,6 @@ struct _GeditNotebookClass
                                         gint           page_num);
 };
 
-/*
- * Public methods
- */
 GType          gedit_notebook_get_type         (void) G_GNUC_CONST;
 
 GtkWidget      *gedit_notebook_new             (void);
@@ -110,13 +93,6 @@ void                gedit_notebook_move_tab         (GeditNotebook *src,
 
 void           gedit_notebook_remove_all_tabs  (GeditNotebook *nb);
 
-void           gedit_notebook_set_close_buttons_sensitive
-                                               (GeditNotebook *nb,
-                                                gboolean       sensitive);
-
-gboolean       gedit_notebook_get_close_buttons_sensitive
-                                               (GeditNotebook *nb);
-
 G_END_DECLS
 
 #endif /* GEDIT_NOTEBOOK_H */


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