[evince] [shell] Add ev_metadata_is_empty()



commit c54c1daa5e398a0c1df101bfc04db9cf6a1fb03e
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Tue Jul 27 17:43:31 2010 +0200

    [shell] Add ev_metadata_is_empty()
    
    It can be used to know whether a document has already metadata

 shell/ev-metadata.c |    6 ++++++
 shell/ev-metadata.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/shell/ev-metadata.c b/shell/ev-metadata.c
index e69ecbd..3a0eefa 100644
--- a/shell/ev-metadata.c
+++ b/shell/ev-metadata.c
@@ -137,6 +137,12 @@ ev_metadata_new (GFile *file)
 }
 
 gboolean
+ev_metadata_is_empty (EvMetadata *metadata)
+{
+	return g_hash_table_size (metadata->items) == 0;
+}
+
+gboolean
 ev_metadata_get_string (EvMetadata  *metadata,
 			const gchar *key,
 			gchar     **value)
diff --git a/shell/ev-metadata.h b/shell/ev-metadata.h
index d8bb17b..f5ce67d 100644
--- a/shell/ev-metadata.h
+++ b/shell/ev-metadata.h
@@ -35,6 +35,7 @@ typedef struct _EvMetadataClass EvMetadataClass;
 
 GType       ev_metadata_get_type              (void) G_GNUC_CONST;
 EvMetadata *ev_metadata_new                   (GFile       *file);
+gboolean    ev_metadata_is_empty              (EvMetadata  *metadata);
 
 gboolean    ev_metadata_get_string            (EvMetadata  *metadata,
 					       const gchar *key,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]