Commit b4b80dbf authored by Felix Riemann's avatar Felix Riemann
Browse files

Fix metadata sidebar with libexif disabled

Otherwise there would be several labels with the text "label".

https://bugzilla.gnome.org/show_bug.cgi?id=751007
parent d45b7f14
......@@ -50,7 +50,8 @@
#include <exempi/xmpconsts.h>
#endif
#if HAVE_EXIF || HAVE_EXEMPI
/* There's no exempi support in the sidebar yet */
#if HAVE_EXIF /*|| HAVE_EXEMPI */
#define HAVE_METADATA 1
#endif
......@@ -81,6 +82,8 @@ struct _EogMetadataSidebarPrivate {
GtkWidget *model_label;
GtkWidget *date_label;
GtkWidget *time_label;
#else
GtkWidget *metadata_grid;
#endif
};
......@@ -156,18 +159,14 @@ static void
eog_metadata_sidebar_update_metadata_section (EogMetadataSidebar *sidebar)
{
EogMetadataSidebarPrivate *priv = sidebar->priv;
EogImage *img = priv->image;
#if HAVE_EXIF
EogImage *img = priv->image;
ExifData *exif_data = NULL;
#endif
if (img) {
#if HAVE_EXIF
exif_data = eog_image_get_exif_info (img);
#endif
}
#if HAVE_EXIF
eog_exif_util_set_label_text (GTK_LABEL (priv->aperture_label),
exif_data, EXIF_TAG_FNUMBER);
eog_exif_util_set_label_text (GTK_LABEL (priv->exposure_label),
......@@ -317,6 +316,18 @@ eog_metadata_sidebar_init (EogMetadataSidebar *sidebar)
g_signal_connect (priv->folder_label, "activate-link",
G_CALLBACK (_folder_label_clicked_cb), sidebar);
#ifndef HAVE_EXIF
{
/* Remove the lower 8 lines as they are empty without libexif*/
guint i;
for (i = 11; i > 3; i--)
{
gtk_grid_remove_row (GTK_GRID (priv->metadata_grid), i);
}
}
#endif /* !HAVE_EXIF */
}
static void
......@@ -433,6 +444,10 @@ eog_metadata_sidebar_class_init (EogMetadataSidebarClass *klass)
gtk_widget_class_bind_template_child_private (widget_class,
EogMetadataSidebar,
time_label);
#else
gtk_widget_class_bind_template_child_private (widget_class,
EogMetadataSidebar,
metadata_grid);
#endif /* HAVE_EXIF */
}
......
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