paperbox r210 - in trunk: . src



Author: markoa
Date: Sun Nov  9 00:26:34 2008
New Revision: 210
URL: http://svn.gnome.org/viewvc/paperbox?rev=210&view=rev

Log:
Updated document subject logic

Modified:
   trunk/ChangeLog
   trunk/src/document-tile.cc
   trunk/src/tracker-phone.cc

Modified: trunk/src/document-tile.cc
==============================================================================
--- trunk/src/document-tile.cc	(original)
+++ trunk/src/document-tile.cc	Sun Nov  9 00:26:34 2008
@@ -418,7 +418,12 @@
         Gtk::Label& title_label = get_title_label();
         title_label.set_ellipsize(Pango::ELLIPSIZE_END);
         title_label.set_max_width_chars(TITLE_BREAK);
-        set_title(doc_->get_subject());
+
+        if (! doc_->get_subject().empty()) {
+            set_title(doc_->get_subject());
+        } else {
+            set_title(doc_->get_file_name());
+        }
     }
 
     void

Modified: trunk/src/tracker-phone.cc
==============================================================================
--- trunk/src/tracker-phone.cc	(original)
+++ trunk/src/tracker-phone.cc	Sun Nov  9 00:26:34 2008
@@ -377,9 +377,11 @@
 
         if (! is_empty_string(keys[TITLE])) {
             Glib::ustring subject(keys[TITLE]);
-            document->set_subject(subject);
-        } else {
-            document->set_subject(document->get_file_name());
+            // avoid some ugly special cases
+            if (subject.lowercase() != "title" &&
+                    subject.lowercase() != "untitled") {
+                document->set_subject(subject);
+            }
         }
 
         if (! is_empty_string(keys[AUTHOR])) {



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