Skip to content

Commit

Permalink
Fix metadata sidebar with libexif disabled
Browse files Browse the repository at this point in the history
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
fxri authored and raveit65 committed Aug 1, 2018
1 parent fd322e8 commit e306d7a
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/eom-metadata-sidebar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

#if HAVE_METADATA
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e306d7a

Please sign in to comment.