Skip to content
Permalink
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

origin commit:
https://gitlab.gnome.org/GNOME/eog/commit/b4b80db
  • Loading branch information...
Felix Riemann authored and raveit65 committed Jun 22, 2015
1 parent fd322e8 commit e306d7ab3596f329805352136c0afc1813343606
Showing with 21 additions and 6 deletions.
  1. +21 −6 src/eom-metadata-sidebar.c
@@ -51,7 +51,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

@@ -82,6 +83,8 @@ struct _EomMetadataSidebarPrivate {
GtkWidget *model_label;
GtkWidget *date_label;
GtkWidget *time_label;
#else
GtkWidget *metadata_grid;
#endif

#if HAVE_METADATA
@@ -166,18 +169,14 @@ static void
eom_metadata_sidebar_update_metadata_section (EomMetadataSidebar *sidebar)
{
EomMetadataSidebarPrivate *priv = sidebar->priv;
EomImage *img = priv->image;
#if HAVE_EXIF
EomImage *img = priv->image;
ExifData *exif_data = NULL;
#endif

if (img) {
#if HAVE_EXIF
exif_data = eom_image_get_exif_info (img);
#endif
}

#if HAVE_EXIF
eom_exif_util_set_label_text (GTK_LABEL (priv->aperture_label),
exif_data, EXIF_TAG_FNUMBER);
eom_exif_util_set_label_text (GTK_LABEL (priv->exposure_label),
@@ -356,6 +355,18 @@ eom_metadata_sidebar_init (EomMetadataSidebar *sidebar)
g_signal_connect (priv->details_button, "clicked",
G_CALLBACK (_details_button_clicked_cb), sidebar);
#endif /* HAVE_METADATA */

#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
@@ -472,6 +483,10 @@ eom_metadata_sidebar_class_init (EomMetadataSidebarClass *klass)
gtk_widget_class_bind_template_child_private (widget_class,
EomMetadataSidebar,
time_label);
#else
gtk_widget_class_bind_template_child_private (widget_class,
EomMetadataSidebar,
metadata_grid);
#endif /* HAVE_EXIF */
#if HAVE_METADATA
gtk_widget_class_bind_template_child_private (widget_class,

0 comments on commit e306d7a

Please sign in to comment.
You can’t perform that action at this time.