gtranslator r3529 - in trunk: . src



Author: icq
Date: Wed Mar 26 22:52:31 2008
New Revision: 3529
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3529&view=rev

Log:
2008-03-26  Ignacio Casal Quinteiro  <nacho resa gmail com>

        * src/application.c:
        Fixed memory leaks.
        * src/window.c:
        Removed unnecessary func and added the update-ui signal emission
        for plugins.


Modified:
   trunk/ChangeLog
   trunk/src/application.c
   trunk/src/window.c

Modified: trunk/src/application.c
==============================================================================
--- trunk/src/application.c	(original)
+++ trunk/src/application.c	Wed Mar 26 22:52:31 2008
@@ -144,6 +144,7 @@
 					   "old gtranslator file: %s", error->message);
 				g_error_free (error);
 				g_object_unref (file);
+				g_free (gtranslator_folder);
 				gtranslator_application_shutdown (application);
 			}
 		}
@@ -155,6 +156,7 @@
 					   
 			g_error_free (error);
 			g_object_unref (file);
+			g_free (gtranslator_folder);
 			gtranslator_application_shutdown (application);
 		}
 		

Modified: trunk/src/window.c
==============================================================================
--- trunk/src/window.c	(original)
+++ trunk/src/window.c	Wed Mar 26 22:52:31 2008
@@ -59,7 +59,6 @@
 struct _GtranslatorWindowPrivate
 {
 	GtkWidget *main_box;
-	GtkWidget *hpaned;
 	
 	GtkWidget *menubar;
 	GtkWidget *view_menu;
@@ -840,7 +839,9 @@
 	po = gtranslator_tab_get_po(tab);
 	msg = gtranslator_po_get_current_message(po);
 	gtranslator_window_update_statusbar_message_count(tab,msg->data, window);
-					    
+
+	gtranslator_plugins_engine_update_plugins_ui (gtranslator_plugins_engine_get_default (),
+						      window, FALSE);
 }
 
 static void
@@ -851,6 +852,9 @@
 	/* Note: we are destroying the tab before the default handler
 	 * seems to be ok, but we need to keep an eye on this. */
 	gtranslator_file_close (NULL, window);
+	
+	gtranslator_plugins_engine_update_plugins_ui (gtranslator_plugins_engine_get_default (),
+						      window, FALSE);
 }
 
 static void
@@ -957,6 +961,9 @@
 			 "notify::state",
 			  G_CALLBACK (sync_state), 
 			  window);
+			  
+	gtranslator_plugins_engine_update_plugins_ui (gtranslator_plugins_engine_get_default (),
+						      window, FALSE);
 }
 
 void
@@ -1584,17 +1591,12 @@
 	return window->priv->ui_manager;
 }
 
-GtkWidget *
-gtranslator_window_get_paned(GtranslatorWindow *window)
-{
-	return window->priv->hpaned;
-}
-
 /**
  * gtranslator_window_get_active_view:
  * @window: a #GtranslationWindow
  *
- * Return value: the active translation view in the #GtranslationWindow
+ * Return value: the active translation view in the #GtranslationWindow or
+ * NULL if there is not tab opened.
  **/
 GtranslatorView *
 gtranslator_window_get_active_view(GtranslatorWindow *window)
@@ -1602,12 +1604,12 @@
 	GtranslatorTab *current_tab;
 	current_tab = gtranslator_window_get_active_tab(window);
 	
-	g_return_if_fail(current_tab != NULL);
+	if (!current_tab)
+		return NULL;
 	
 	return gtranslator_tab_get_active_view(current_tab);
 }
 
-
 /**
  * gtranslator_window_get_all_views:
  * @window: the #GtranslationWindow



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