eog r4730 - in trunk: . plugins plugins/reload src



Author: friemann
Date: Sun Sep  7 12:35:05 2008
New Revision: 4730
URL: http://svn.gnome.org/viewvc/eog?rev=4730&view=rev

Log:
2008-09-07  Felix Riemann  <friemann svn gnome org>

	* src/eog-window.c: (eog_window_reload_image):
	* src/eog-window.h:
	Make the reload plugin work again. Most of the code is internal now to
	have the reloading done in a more correct and less error-prone way.
	Also there were signs that other plugins might need this functionality
	as well. Fixes bug #548392 (Claudio Saavedra, Felix Riemann).


Modified:
   trunk/ChangeLog
   trunk/plugins/ChangeLog
   trunk/plugins/reload/eog-reload-plugin.c
   trunk/src/eog-window.c
   trunk/src/eog-window.h

Modified: trunk/plugins/reload/eog-reload-plugin.c
==============================================================================
--- trunk/plugins/reload/eog-reload-plugin.c	(original)
+++ trunk/plugins/reload/eog-reload-plugin.c	Sun Sep  7 12:35:05 2008
@@ -28,14 +28,7 @@
 reload_cb (GtkAction	*action,
 	  EogWindow *window)
 {
-	GtkWidget *thumbview = eog_window_get_thumb_view (window);
-	GtkWidget *view = eog_window_get_view (window);
-
-	eog_scroll_view_set_image (EOG_SCROLL_VIEW (view), NULL);
-
-	/* Re-select current image in order to trigger the image reload */
-	eog_thumb_view_select_single (EOG_THUMB_VIEW (thumbview), 
-				      EOG_THUMB_VIEW_SELECT_CURRENT);
+        eog_window_reload_image (window);
 }
 
 static const GtkActionEntry action_entries[] =

Modified: trunk/src/eog-window.c
==============================================================================
--- trunk/src/eog-window.c	(original)
+++ trunk/src/eog-window.c	Sun Sep  7 12:35:05 2008
@@ -5022,3 +5022,23 @@
 
         return empty;
 }
+
+void
+eog_window_reload_image (EogWindow *window)
+{
+	GtkWidget *view;
+
+	g_return_if_fail (EOG_IS_WINDOW (window));
+
+	if (window->priv->image == NULL)
+		return;
+
+	g_object_unref (window->priv->image);
+	window->priv->image = NULL;
+
+	view = eog_window_get_view (window);
+	eog_scroll_view_set_image (EOG_SCROLL_VIEW (view), NULL);
+
+	eog_thumb_view_select_single (EOG_THUMB_VIEW (window->priv->thumbview),
+				      EOG_THUMB_VIEW_SELECT_CURRENT);
+}

Modified: trunk/src/eog-window.h
==============================================================================
--- trunk/src/eog-window.h	(original)
+++ trunk/src/eog-window.h	Sun Sep  7 12:35:05 2008
@@ -116,6 +116,7 @@
 
 gboolean      eog_window_is_empty 	(EogWindow       *window);
 
+void          eog_window_reload_image (EogWindow *window);
 G_END_DECLS
 
 #endif



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