[gedit] Small refactoring to make commands-file not aware of notebook



commit 37c93eac58230394e70af7ccb613566f50156423
Author: Paolo Borelli <pborelli gnome org>
Date:   Wed Jun 2 19:21:46 2010 +0200

    Small refactoring to make commands-file not aware of notebook

 gedit/gedit-commands-file.c |    9 ++++-----
 gedit/gedit-window.c        |    9 +++++++++
 gedit/gedit-window.h        |    2 ++
 3 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 729af88..44006e9 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -1471,19 +1471,18 @@ static void
 save_and_close_all_documents (const GList  *docs,
 			      GeditWindow  *window)
 {
-	GList  *tabs;
-	GList  *l;
+	GList *tabs;
+	GList *l;
 	GSList *sl;
 	GSList *tabs_to_save_as;
 	GSList *tabs_to_save_and_close;
-	GList  *tabs_to_close;
+	GList *tabs_to_close;
 
 	gedit_debug (DEBUG_COMMANDS);
 
 	g_return_if_fail (!(gedit_window_get_state (window) & GEDIT_WINDOW_STATE_PRINTING));
 
-	tabs = gtk_container_get_children (
-			GTK_CONTAINER (_gedit_window_get_notebook (window)));
+	tabs = _gedit_window_get_all_tabs (window);
 
 	tabs_to_save_as = NULL;
 	tabs_to_save_and_close = NULL;
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index ffa24cb..af7f74c 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -4816,6 +4816,15 @@ gedit_window_get_unsaved_documents (GeditWindow *window)
 	return g_list_reverse (unsaved_docs);
 }
 
+GList *
+_gedit_window_get_all_tabs (GeditWindow *window)
+{
+	g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL);
+
+	return gtk_container_get_children (
+			GTK_CONTAINER (_gedit_window_get_notebook (window)));
+}
+
 void 
 _gedit_window_set_saving_session_state (GeditWindow *window,
 					gboolean     saving_session)
diff --git a/gedit/gedit-window.h b/gedit/gedit-window.h
index 862a78c..014dc59 100644
--- a/gedit/gedit-window.h
+++ b/gedit/gedit-window.h
@@ -188,6 +188,8 @@ void		 _gedit_window_unfullscreen		(GeditWindow         *window);
 
 gboolean	 _gedit_window_is_fullscreen		(GeditWindow         *window);
 
+GList		*_gedit_window_get_all_tabs		(GeditWindow         *window);
+
 /* these are in gedit-window because of screen safety */
 void		 _gedit_recent_add			(GeditWindow	     *window,
 							 GFile               *location,



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