summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Riemann <[email protected]>2015-06-22 19:51:25 +0200
committerraveit65 <[email protected]>2018-08-01 12:20:45 +0200
commite306d7ab3596f329805352136c0afc1813343606 (patch)
tree00c4434a2e0ae3a3e1c74572b99ce050134cf05a
parentfd322e81d7a8d6affbefbb6a4055a1f106987f83 (diff)
downloadeom-e306d7ab3596f329805352136c0afc1813343606.tar.bz2
eom-e306d7ab3596f329805352136c0afc1813343606.tar.xz
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
-rw-r--r--src/eom-metadata-sidebar.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/eom-metadata-sidebar.c b/src/eom-metadata-sidebar.c
index e7d2613..ae85a3c 100644
--- a/src/eom-metadata-sidebar.c
+++ b/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,