[solang] Display human readable string for Exif fields represented by enums



commit 6f129babe9eacc5597739e8274392b2841aac54e
Author: Debarshi Ray <rishi gnu org>
Date:   Tue Feb 2 03:31:42 2010 +0200

    Display human readable string for Exif fields represented by enums
    
    Some of the Exif fields are represented in Tracker by pre-defined
    instances similar to enumerated types. eg., flash, white balance and
    metering mode. Instead of showing the internal representation in the
    search basket, the human readable equivalent is displayed.

 src/attribute/basic-exif-view.cpp |    3 +++
 src/common/exif-data-key.cpp      |    2 +-
 src/common/exif-data-key.h        |   12 +++++++++++-
 3 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/attribute/basic-exif-view.cpp b/src/attribute/basic-exif-view.cpp
index 04fda6d..5742e69 100644
--- a/src/attribute/basic-exif-view.cpp
+++ b/src/attribute/basic-exif-view.cpp
@@ -132,6 +132,7 @@ BasicExifView::populate(const ExifData& data) throw()
         const Glib::ustring flash_desc = _("Flash");
         const ExifDataKeyPtr key(new ExifDataKey(
                                      flash_desc,
+                                     flash_data,
                                      "nmm:flash",
                                      data.get_flash_enum()));
 
@@ -189,6 +190,7 @@ BasicExifView::populate(const ExifData& data) throw()
         const Glib::ustring metering_mode_desc = _("Metering mode");
         const ExifDataKeyPtr key(new ExifDataKey(
                                      metering_mode_desc,
+                                     metering_mode_data,
                                      "nmm:meteringMode",
                                      data.get_metering_mode_enum()));
 
@@ -229,6 +231,7 @@ BasicExifView::populate(const ExifData& data) throw()
         const Glib::ustring white_balance_desc = _("White balance");
         const ExifDataKeyPtr key(new ExifDataKey(
                                      white_balance_desc,
+                                     white_balance_data,
                                      "nmm:whiteBalance",
                                      data.get_white_balance_enum()));
 
diff --git a/src/common/exif-data-key.cpp b/src/common/exif-data-key.cpp
index 7ed2953..5fc3580 100644
--- a/src/common/exif-data-key.cpp
+++ b/src/common/exif-data-key.cpp
@@ -29,7 +29,7 @@ ExifDataKey::get_id() const throw()
 Glib::ustring
 ExifDataKey::get_criteria_description() const throw()
 {
-    return title_ + ": " + value_;
+    return title_;
 }
 
 Glib::ustring
diff --git a/src/common/exif-data-key.h b/src/common/exif-data-key.h
index 9fd534a..489f9a6 100644
--- a/src/common/exif-data-key.h
+++ b/src/common/exif-data-key.h
@@ -35,9 +35,19 @@ class ExifDataKey :
 
     public:
         ExifDataKey( const Glib::ustring &title,
+                     const Glib::ustring & title_secondary,
                      const Glib::ustring & key,
                      const Glib::ustring & value )
-            :title_( title ),
+            :title_( title + ": " + title_secondary),
+            key_( key ),
+            value_( value )
+        {
+        }
+
+        ExifDataKey( const Glib::ustring &title,
+                     const Glib::ustring & key,
+                     const Glib::ustring & value )
+            :title_( title + ": " + value),
             key_( key ),
             value_( value )
         {



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