Index: ChangeLog =================================================================== --- ChangeLog (révision 730) +++ ChangeLog (copie de travail) @@ -1,9 +1,14 @@ +2007-07-26 Laurent Aguerreche + * Fixed printing of date for audio files in TST + + 2007-07-25 Patch from Jerry Tan * updated applet to 0.6.0 settings * fixed crasher and made read tags case insensitive for html extractor + 2007-07-25 Jamie McCracken * Based on patch by Marcus Fritzsch @@ -11,12 +16,12 @@ * Removed forced indexing of home dir when no watch dirs specified (home is default in cfg file) - 2007-07-24 Michael Biebl * Include the deskbar-applet plugin on make dist * Show if deskbar-applet support is enabled in the ./configure summary + 2007-07-18 Patch from Jerry Tan * Fixed command line tracker-tag Index: src/libtracker-gtk/tracker-metadata-tile.c =================================================================== --- src/libtracker-gtk/tracker-metadata-tile.c (révision 730) +++ src/libtracker-gtk/tracker-metadata-tile.c (copie de travail) @@ -221,6 +221,7 @@ static void tracker_metadata_tile_show (TrackerMetadataTile *tile); static void _property_to_label (GtkWidget *label, const char *prop, const char *string); static void _date_to_label (GtkWidget *label, const char *prop, const char *string); +static void _year_to_label (GtkWidget *label, const char *prop, const char *string); static void _size_to_label (GtkWidget *label, const char *prop, const char *string); static void _dimensions_to_label (GtkWidget *label, const char *width, const char *height, const char *string); static void _seconds_to_label (GtkWidget *label, const char *prop, const char *string); @@ -636,7 +637,7 @@ _seconds_to_label ( priv->info1, array[AUDIO_DURATION] , _("Duration : %s")); _property_to_label ( priv->info2, array[AUDIO_GENRE] , _("Genre : %s")); _bitrate_to_label ( priv->info3, array[AUDIO_BITRATE] , _("Bitrate : %s Kbs")); - _date_to_label ( priv->info4, array[AUDIO_RELEASEDATE] , _("Year : %s")); + _year_to_label ( priv->info4, array[AUDIO_RELEASEDATE] , _("Year : %s")); _size_to_label ( priv->info5, array[AUDIO_SIZE] , _("Size : %s")); _property_to_label ( priv->info6, array[AUDIO_CODEC] , _("Codec : %s")); @@ -899,7 +900,7 @@ char *format; size = atol (prop); - format = g_strdup_printf ("%d", size); + format = g_strdup_printf ("%ld", size); if (size) { temp = g_strdup_printf (string, format); @@ -940,25 +941,55 @@ /* Converts ISO date to something human readable */ +static gboolean +get_time_from_iso (const char *iso, GDate *val) +{ + g_return_val_if_fail (val, FALSE); + + time_t my_time = atoi (iso); + + if (my_time != 0) { + g_date_set_time_t (val, my_time); + return TRUE; + } else { + return FALSE; + } +} + static void _date_to_label (GtkWidget *label, const char *iso, const char *string) { GDate val; - char *temp = NULL, *date; - time_t my_time; + char *temp = NULL; if (string) { - my_time = atoi (iso); - - if (my_time != 0) { - - g_date_set_time_t (&val, my_time); + if (get_time_from_iso (iso, &val)) { gchar buf[256]; - g_date_strftime(buf,256,"%a %d %b %Y", &val); + g_date_strftime (buf, 256, "%a %d %b %Y", &val); temp = g_strdup_printf (string, buf); + } + } - } + if (!temp) { + temp = g_strdup_printf (string, _("Unknown")); + } + gtk_label_set_markup (GTK_LABEL (label), temp); + g_free (temp); +} + +static void +_year_to_label (GtkWidget *label, const char *iso, const char *string) +{ + GDate val; + char *temp = NULL; + + if (string) { + if (get_time_from_iso (iso, &val)) { + gchar buf[32]; + g_date_strftime (buf, 32, "%Y", &val); + temp = g_strdup_printf (string, buf); + } } if (!temp) {