Commit 95f06aa8 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

edit metadata: fixed deletion of the date

when the user selects "no date", delete the general::datetime attribute
instead of setting its value to a void string.
parent 74564d14
...@@ -312,7 +312,14 @@ gth_edit_comment_page_real_update_info (GthEditMetadataPage *base, ...@@ -312,7 +312,14 @@ gth_edit_comment_page_real_update_info (GthEditMetadataPage *base,
/* date */ /* date */
if (gtk_combo_box_get_active (GTK_COMBO_BOX (self->priv->date_combobox)) != NO_CHANGE) { switch (gtk_combo_box_get_active (GTK_COMBO_BOX (self->priv->date_combobox))) {
case NO_CHANGE:
break;
case NO_DATE:
g_file_info_remove_attribute (info, "general::datetime");
break;
default:
{
char *exif_date; char *exif_date;
if (gtk_combo_box_get_active (GTK_COMBO_BOX (self->priv->date_combobox)) == CURRENT_DATE) if (gtk_combo_box_get_active (GTK_COMBO_BOX (self->priv->date_combobox)) == CURRENT_DATE)
...@@ -320,7 +327,6 @@ gth_edit_comment_page_real_update_info (GthEditMetadataPage *base, ...@@ -320,7 +327,6 @@ gth_edit_comment_page_real_update_info (GthEditMetadataPage *base,
else else
exif_date = get_date_from_option (self, gtk_combo_box_get_active (GTK_COMBO_BOX (self->priv->date_combobox)), info); exif_date = get_date_from_option (self, gtk_combo_box_get_active (GTK_COMBO_BOX (self->priv->date_combobox)), info);
if (! only_modified_fields if (! only_modified_fields
|| (gtk_combo_box_get_active (GTK_COMBO_BOX (self->priv->date_combobox)) == NO_DATE)
|| ! gth_file_data_attribute_equal (file_data, "general::datetime", exif_date)) || ! gth_file_data_attribute_equal (file_data, "general::datetime", exif_date))
{ {
metadata = g_object_new (GTH_TYPE_METADATA, metadata = g_object_new (GTH_TYPE_METADATA,
...@@ -333,6 +339,9 @@ gth_edit_comment_page_real_update_info (GthEditMetadataPage *base, ...@@ -333,6 +339,9 @@ gth_edit_comment_page_real_update_info (GthEditMetadataPage *base,
} }
g_free (exif_date); g_free (exif_date);
break;
}
} }
/* tags */ /* tags */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment