Code

Wire up new SPObject signal to DocumentSubset, so object order changes will be reflec...
authormental <mental@users.sourceforge.net>
Sun, 5 Mar 2006 22:04:56 +0000 (22:04 +0000)
committermental <mental@users.sourceforge.net>
Sun, 5 Mar 2006 22:04:56 +0000 (22:04 +0000)
ChangeLog
src/document-subset.cpp

index 8edea42d5febc60a1512d8bf2b8f106a00477e18..9e48bfb3327d643b28df2c66ad4d7e4c939124aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-03-05  MenTaLguY  <mental@rydia.net>
+
+    * src/document-subset.cpp:
+
+         Wire up new SPObject signal to DocumentSubset, so order changes
+         will be reflected in the subset.
+
 2006-03-05  MenTaLguY  <mental@rydia.net>
 
        * src/sp-object.h, src/sp-object.cpp:
index 08638b9f3fd517d9aaf00c56ad9e4a9a176dc336..d156b045b23dab2d2f58525e24f600ddb65f8995 100644 (file)
@@ -15,6 +15,7 @@
 #include <glib/gmessages.h>
 
 #include <sigc++/signal.h>
+#include <sigc++/functors/mem_fun.h>
 
 #include "util/list.h"
 #include "util/reverse-list.h"
@@ -36,6 +37,7 @@ struct DocumentSubset::Relations : public GC::Managed<GC::ATOMIC>,
         Siblings children;
 
         gulong release_connection;
+        sigc::connection position_changed_connection;
 
         Record() : parent(NULL), release_connection(0) {}
 
@@ -148,6 +150,10 @@ private:
         record.release_connection
           = g_signal_connect(obj, "release",
                              (GCallback)&Relations::_release_object, this);
+        record.position_changed_connection
+          = obj->connectPositionChanged(
+              sigc::mem_fun(this, &Relations::reorder)
+            );
         return record;
     }
 
@@ -161,6 +167,7 @@ private:
             g_signal_handler_disconnect(obj, record.release_connection);
             record.release_connection = 0;
         }
+        record.position_changed_connection.disconnect();
         records.erase(obj);
         removed_signal.emit(obj);
         sp_object_unref(obj);