eog r4469 - trunk/src



Author: lucasr
Date: Sat Mar 15 15:23:48 2008
New Revision: 4469
URL: http://svn.gnome.org/viewvc/eog?rev=4469&view=rev

Log:
Remove prev_status hack as it's not necessary anymore after
the migration to gio.


Modified:
   trunk/src/eog-image.c
   trunk/src/eog-image.h
   trunk/src/eog-list-store.c

Modified: trunk/src/eog-image.c
==============================================================================
--- trunk/src/eog-image.c	(original)
+++ trunk/src/eog-image.c	Sat Mar 15 15:23:48 2008
@@ -245,7 +245,6 @@
 	img->priv->modified = FALSE;
 	img->priv->status_mutex = g_mutex_new ();
 	img->priv->status = EOG_IMAGE_STATUS_UNKNOWN;
-	img->priv->prev_status = EOG_IMAGE_STATUS_UNKNOWN;
 	img->priv->is_monitored = FALSE;
 	img->priv->undo_stack = NULL;
 	img->priv->trans = NULL;
@@ -1569,14 +1568,6 @@
 
 	priv = img->priv;
 
-	/* FIXME: Because of a bug in gnome-vfs file monitoring, we need to avoid
-         * an image that is being saved to be removed and re-added by the monitor
-         * handler. We do this by setting the image's status to "saving" and, in
-         * case the image is being monitored, the status is only restored after the
-         * "fake" image deletion is notified by gnome-vfs. Same aproach is used in
-         * eog_image_save_as_by_info(). See bug #46830. */
-	priv->prev_status = priv->status;
-
 	/* Image is now being saved */
 	priv->status = EOG_IMAGE_STATUS_SAVING;
 
@@ -1632,10 +1623,7 @@
 	g_free (tmp_file_path);
 	g_object_unref (tmp_file);
 
-	/* Restore previous status only if is not monitored image */
-	if (!priv->is_monitored) {
-		priv->status = priv->prev_status;
-	}
+	priv->status = EOG_IMAGE_STATUS_UNKNOWN;
 
 	return success;
 }
@@ -1692,8 +1680,6 @@
 
 	priv = img->priv;
 
-	priv->prev_status = priv->status;
-
 	/* fail if there is no image to save */
 	if (priv->image == NULL) {
 		g_set_error (error, 
@@ -1750,10 +1736,7 @@
 	g_object_unref (tmp_file);
 	g_free (tmp_file_path);
 
-	/* Restore previous status only if is not monitored image */
-	if (!priv->is_monitored) {
-		priv->status = priv->prev_status;
-	}
+	priv->status = EOG_IMAGE_STATUS_UNKNOWN;
 
 	return success;
 }
@@ -2007,22 +1990,6 @@
 }
 
 void
-eog_image_restore_status (EogImage *img)
-{
-	g_return_if_fail (EOG_IS_IMAGE (img));
-
-	img->priv->status = img->priv->prev_status;
-}
-
-void
-eog_image_set_is_monitored (EogImage *img, gboolean is_monitored)
-{
-	g_return_if_fail (EOG_IS_IMAGE (img));
-
-	img->priv->is_monitored = is_monitored;
-}
-
-void
 eog_image_data_ref (EogImage *img)
 {
 	g_return_if_fail (EOG_IS_IMAGE (img));

Modified: trunk/src/eog-image.h
==============================================================================
--- trunk/src/eog-image.h	(original)
+++ trunk/src/eog-image.h	Sat Mar 15 15:23:48 2008
@@ -174,11 +174,6 @@
 
 EogImageStatus    eog_image_get_status               (EogImage   *img);
 
-void              eog_image_restore_status           (EogImage   *img);
-
-void              eog_image_set_is_monitored         (EogImage   *img,
-						      gboolean    is_monitored);
-
 void              eog_image_transform                (EogImage   *img, 
 						      EogTransform *trans,
 						      EogJob     *job);

Modified: trunk/src/eog-list-store.c
==============================================================================
--- trunk/src/eog-list-store.c	(original)
+++ trunk/src/eog-list-store.c	Sat Mar 15 15:23:48 2008
@@ -344,8 +344,7 @@
 
 static void 
 eog_list_store_append_image_from_file (EogListStore *store, 
-				       GFile *file,
-				       gboolean is_monitored)
+				       GFile *file)
 {
 	EogImage *image;
 	
@@ -353,8 +352,6 @@
 
 	image = eog_image_new_file (file);
 
-	eog_image_set_is_monitored (image, is_monitored);
-
 	eog_list_store_append_image (store, image);
 }
 
@@ -387,7 +384,7 @@
 			}
 		} else {
 			if (eog_image_is_supported_mime_type (mimetype)) {
-				eog_list_store_append_image_from_file (store, file, TRUE);
+				eog_list_store_append_image_from_file (store, file);
 			}
 		}
 		g_object_unref (file_info);
@@ -400,11 +397,7 @@
 					    EOG_LIST_STORE_EOG_IMAGE, &image,
 					    -1);
 
-			if (eog_image_get_status (image) != EOG_IMAGE_STATUS_SAVING) {
-				eog_list_store_remove (store, &iter);
-			} else {
-				eog_image_restore_status (image);
-			}
+			eog_list_store_remove (store, &iter);
 		}
 		break;
 	case G_FILE_MONITOR_EVENT_CREATED:
@@ -418,7 +411,7 @@
 			mimetype = g_file_info_get_content_type (file_info);
 
 			if (eog_image_is_supported_mime_type (mimetype)) {
-				eog_list_store_append_image_from_file (store, file, TRUE);
+				eog_list_store_append_image_from_file (store, file);
 			}
 			g_object_unref (file_info);
 		}
@@ -469,7 +462,7 @@
 
 	if (load_uri) {
 		child = g_file_get_child (directory, name);
-		eog_list_store_append_image_from_file (store, child, TRUE);
+		eog_list_store_append_image_from_file (store, child);
 	}
 }
 
@@ -557,14 +550,14 @@
 				if (!is_file_in_list_store_file (store,
 								 initial_file, 
 								 &iter)) {
-					eog_list_store_append_image_from_file (store, initial_file, TRUE);
+					eog_list_store_append_image_from_file (store, initial_file);
 				}
 			} else {
-				eog_list_store_append_image_from_file (store, initial_file, FALSE);
+				eog_list_store_append_image_from_file (store, initial_file);
 			}
 		} else if (file_type == G_FILE_TYPE_REGULAR && 
 			   g_list_length (file_list) > 1) {
-			eog_list_store_append_image_from_file (store, file, FALSE);
+			eog_list_store_append_image_from_file (store, file);
 		}
 	}
 



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