[frogr] Don't store the FspLocation as private atribute in the loader



commit f151bbc2b5f72d7d321847b98f01f8dab10200ff
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Mon Aug 15 16:50:30 2011 +0200

    Don't store the FspLocation as private atribute in the loader

 src/frogr-picture-loader.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/frogr-picture-loader.c b/src/frogr-picture-loader.c
index 8f6a49a..8e4134e 100644
--- a/src/frogr-picture-loader.c
+++ b/src/frogr-picture-loader.c
@@ -65,7 +65,6 @@ struct _FrogrPictureLoaderPrivate
   FspLicense license;
   FspSafetyLevel safety_level;
   FspContentType content_type;
-  FspDataLocation *location;
 
   FrogrPictureLoadedCallback picture_loaded_cb;
   FrogrPicturesLoadedCallback pictures_loaded_cb;
@@ -372,6 +371,8 @@ _load_next_picture_cb (GObject *object,
           exif_data = exif_loader_get_data (exif_loader);
           if (exif_data)
             {
+              FspDataLocation *location;
+
               exif_entry = exif_data_get_entry (exif_data, EXIF_TAG_DATE_TIME);
               if (exif_entry)
                 {
@@ -386,11 +387,12 @@ _load_next_picture_cb (GObject *object,
                   else
                     g_warning ("Found DateTime exif tag of invalid type");
                 }
-              priv->location = get_location_from_exif (exif_data);
-              if (priv->location != NULL)
+              location = get_location_from_exif (exif_data);
+              if (location != NULL)
                 {
                   /* frogr_picture_set_location takes ownership of location */
-                  frogr_picture_set_location (fpicture, priv->location);
+                  frogr_picture_set_location (fpicture, location);
+                  fsp_data_free (FSP_DATA (location));
                 }
               exif_data_unref (exif_data);
             }
@@ -486,7 +488,6 @@ _frogr_picture_loader_finalize (GObject* object)
   /* Free */
   g_slist_foreach (priv->file_uris, (GFunc)g_free, NULL);
   g_slist_free (priv->file_uris);
-  fsp_data_free (FSP_DATA (priv->location));
 
   G_OBJECT_CLASS (frogr_picture_loader_parent_class)->finalize(object);
 }



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