paperbox r179 - in trunk: . src



Author: markoa
Date: Sat Aug 23 19:42:31 2008
New Revision: 179
URL: http://svn.gnome.org/viewvc/paperbox?rev=179&view=rev

Log:
A workaround for tag clicking on null CategoryEditorData

Modified:
   trunk/ChangeLog
   trunk/src/category-editor.cc

Modified: trunk/src/category-editor.cc
==============================================================================
--- trunk/src/category-editor.cc	(original)
+++ trunk/src/category-editor.cc	Sat Aug 23 19:42:31 2008
@@ -23,6 +23,7 @@
 #include <list>
 #include <glib/gi18n.h>
 #include <gtkmm/stock.h>
+#include <glibmm-utils/log-stream-utils.h>
 #include <gtkmm-utils/dialog.h>
 #include "browser.hh"
 #include "category-editor.hh"
@@ -348,6 +349,12 @@
     {
         shared_ptr<CategoryEditorData> data(
             model_->get_category(selected_name_));
+        if (! data.get()) {
+            //TODO: This happens when there are no categories defined.
+            // At that point there is still no buffer.
+            LOG_DD("Trying to do something with an empty buffer.");
+            return;
+        }
 
         (data->category->get_tags_as_string() != data->buffer->get_text())
             ? button_save_.set_sensitive()



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