eog r4480 - in trunk: . src



Author: csaavedra
Date: Thu Mar 20 02:17:13 2008
New Revision: 4480
URL: http://svn.gnome.org/viewvc/eog?rev=4480&view=rev

Log:
2008-03-19  Claudio Saavedra  <csaavedra alumnos utalca cl>

	* src/eog-exif-util.c: (eog_exif_util_format_date_with_strptime),
	(eog_exif_util_format_date_by_hand): Return NULL if the date
	can't be formatted.
	* src/eog-thumb-view.c: (tb_on_query_tooltip_cb): Do not display
	the date in the tooltip if this is unknown.

	Do not show the date as "Unknown" if it can't be formatted, simply
	ignore it.



Modified:
   trunk/ChangeLog
   trunk/src/eog-exif-util.c
   trunk/src/eog-thumb-view.c

Modified: trunk/src/eog-exif-util.c
==============================================================================
--- trunk/src/eog-exif-util.c	(original)
+++ trunk/src/eog-exif-util.c	Thu Mar 20 02:17:13 2008
@@ -54,9 +54,8 @@
 	if (p == date + strlen (date)) {
 		dlen = strftime (tmp_date, 100 * sizeof(gchar), "%x %X", &tm);
 		new_date = g_strndup (tmp_date, dlen);
-	} else {
-		new_date = g_strdup (_("Unknown"));
 	}
+
 	return new_date;
 }
 #else
@@ -71,7 +70,7 @@
 			 &year, &month, &day, &hour, &minutes, &seconds);
 
 	if (result < 3 || !g_date_valid_dmy (day, month, year)) {
-		return g_strdup (_("Unknown"));
+		return NULL;
 	} else {
 		gchar tmp_date[100];
 		gsize dlen;
@@ -93,7 +92,7 @@
 		}
 
 		if (dlen == 0) 
-			return g_strdup (_("Unknown"));
+			return NULL;
 		else
 			new_date = g_strndup (tmp_date, dlen);
 	}

Modified: trunk/src/eog-thumb-view.c
==============================================================================
--- trunk/src/eog-thumb-view.c	(original)
+++ trunk/src/eog-thumb-view.c	Thu Mar 20 02:17:13 2008
@@ -455,15 +455,17 @@
 		date = eog_exif_util_format_date (
 				eog_exif_util_get_value (exif_data, EXIF_TAG_DATE_TIME_ORIGINAL, time_buffer, 32));
 
-		extra_info = g_strdup_printf ("\n%s %s", _("Taken on"), date);
+		if (date) {
+			extra_info = g_strdup_printf ("\n%s %s", _("Taken on"), date);
 
-		tmp = g_strconcat (tooltip_string, extra_info, NULL);
+			tmp = g_strconcat (tooltip_string, extra_info, NULL);
 
-		g_free (date);
-		g_free (extra_info);
-		g_free (tooltip_string);
+			g_free (date);
+			g_free (extra_info);
+			g_free (tooltip_string);
 
-		tooltip_string = tmp;
+			tooltip_string = tmp;
+		}
 		exif_data_unref (exif_data);
 	}
 #endif



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