[gedit] Fix warnings moving tab to a new window.



commit df3787eb2f9febbd577695efe7daccf915914826
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Jun 22 23:05:45 2010 +0200

    Fix warnings moving tab to a new window.

 gedit/gedit-commands-documents.c |    5 -----
 gedit/gedit-window.c             |    8 +++++---
 2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/gedit/gedit-commands-documents.c b/gedit/gedit-commands-documents.c
index 354fc9f..0846f96 100644
--- a/gedit/gedit-commands-documents.c
+++ b/gedit/gedit-commands-documents.c
@@ -70,7 +70,6 @@ void
 _gedit_cmd_documents_move_to_new_window (GtkAction   *action,
 					 GeditWindow *window)
 {
-	GeditNotebook *old_notebook;
 	GeditTab *tab;
 
 	gedit_debug (DEBUG_COMMANDS);
@@ -80,10 +79,6 @@ _gedit_cmd_documents_move_to_new_window (GtkAction   *action,
 	if (tab == NULL)
 		return;
 
-	old_notebook = GEDIT_NOTEBOOK (_gedit_window_get_notebook (window));
-
-	g_return_if_fail (gtk_notebook_get_n_pages (GTK_NOTEBOOK (old_notebook)) > 1);
-
 	_gedit_window_move_tab_to_new_window (window, tab);
 }
 
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index e879c80..583eb9c 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -4586,9 +4586,11 @@ _gedit_window_move_tab_to_new_window (GeditWindow *window,
 
 	g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL);
 	g_return_val_if_fail (GEDIT_IS_TAB (tab), NULL);
-	g_return_val_if_fail (gedit_multi_notebook_get_n_tabs (
-				window->priv->multi_notebook) > 1,
-			      NULL);
+	g_return_val_if_fail (gedit_multi_notebook_get_n_notebooks (
+	                        window->priv->multi_notebook) > 1 &&
+	                      gedit_multi_notebook_get_n_tabs (
+	                        window->priv->multi_notebook) > 1,
+	                      NULL);
 
 	new_window = clone_window (window);
 



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