Skip to content

Commit e306d7a

Browse files
fxriraveit65
authored andcommitted
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
1 parent fd322e8 commit e306d7a

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

src/eom-metadata-sidebar.c

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
#include <exempi/xmpconsts.h>
5252
#endif
5353

54-
#if HAVE_EXIF || HAVE_EXEMPI
54+
/* There's no exempi support in the sidebar yet */
55+
#if HAVE_EXIF /*|| HAVE_EXEMPI */
5556
#define HAVE_METADATA 1
5657
#endif
5758

@@ -82,6 +83,8 @@ struct _EomMetadataSidebarPrivate {
8283
GtkWidget *model_label;
8384
GtkWidget *date_label;
8485
GtkWidget *time_label;
86+
#else
87+
GtkWidget *metadata_grid;
8588
#endif
8689

8790
#if HAVE_METADATA
@@ -166,18 +169,14 @@ static void
166169
eom_metadata_sidebar_update_metadata_section (EomMetadataSidebar *sidebar)
167170
{
168171
EomMetadataSidebarPrivate *priv = sidebar->priv;
169-
EomImage *img = priv->image;
170172
#if HAVE_EXIF
173+
EomImage *img = priv->image;
171174
ExifData *exif_data = NULL;
172-
#endif
173175

174176
if (img) {
175-
#if HAVE_EXIF
176177
exif_data = eom_image_get_exif_info (img);
177-
#endif
178178
}
179179

180-
#if HAVE_EXIF
181180
eom_exif_util_set_label_text (GTK_LABEL (priv->aperture_label),
182181
exif_data, EXIF_TAG_FNUMBER);
183182
eom_exif_util_set_label_text (GTK_LABEL (priv->exposure_label),
@@ -356,6 +355,18 @@ eom_metadata_sidebar_init (EomMetadataSidebar *sidebar)
356355
g_signal_connect (priv->details_button, "clicked",
357356
G_CALLBACK (_details_button_clicked_cb), sidebar);
358357
#endif /* HAVE_METADATA */
358+
359+
#ifndef HAVE_EXIF
360+
{
361+
/* Remove the lower 8 lines as they are empty without libexif*/
362+
guint i;
363+
364+
for (i = 11; i > 3; i--)
365+
{
366+
gtk_grid_remove_row (GTK_GRID (priv->metadata_grid), i);
367+
}
368+
}
369+
#endif /* !HAVE_EXIF */
359370
}
360371

361372
static void
@@ -472,6 +483,10 @@ eom_metadata_sidebar_class_init (EomMetadataSidebarClass *klass)
472483
gtk_widget_class_bind_template_child_private (widget_class,
473484
EomMetadataSidebar,
474485
time_label);
486+
#else
487+
gtk_widget_class_bind_template_child_private (widget_class,
488+
EomMetadataSidebar,
489+
metadata_grid);
475490
#endif /* HAVE_EXIF */
476491
#if HAVE_METADATA
477492
gtk_widget_class_bind_template_child_private (widget_class,

0 commit comments

Comments
 (0)