Code

Filter effects dialog:
[inkscape.git] / src / document-undo.cpp
index 911258ee050e70e39b49c0c332d122a9ed2653e2..81125833110313c50b78793bbadecf8b6ee35dde 100644 (file)
@@ -143,19 +143,20 @@ typedef SimpleEvent<Event::INTERACTION> InteractionEvent;
 class CommitEvent : public InteractionEvent {
 public:
 
-    CommitEvent(SPDocument *doc, const gchar *key, const unsigned int type,
-                Glib::ustring const &description)
+    CommitEvent(SPDocument *doc, const gchar *key, const unsigned int type)
     : InteractionEvent(share_static_string("commit"))
     {
         _addProperty(share_static_string("timestamp"), timestamp()); 
+        gchar *serial = g_strdup_printf("%lu", doc->serial());
+        _addProperty(share_static_string("document"), serial);
+        g_free(serial);
         Verb *verb = Verb::get(type);
         if (verb) {
-            _addProperty(share_static_string("verb"), verb->get_id());
+            _addProperty(share_static_string("context"), verb->get_id());
         }
         if (key) {
             _addProperty(share_static_string("merge-key"), key);
         }
-        _addProperty(share_static_string("description"), description.c_str());
     }
 };
 
@@ -169,7 +170,7 @@ sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int ev
        g_assert (doc->priv != NULL);
        g_assert (doc->priv->sensitive);
 
-        Inkscape::Debug::Logger::write<CommitEvent>(doc, key, event_type, event_description);
+        Inkscape::Debug::EventTracker<CommitEvent> tracker(doc, key, event_type);
 
        doc->collectOrphans();
 
@@ -225,9 +226,7 @@ sp_document_cancel (SPDocument *doc)
        sp_repr_begin_transaction (doc->rdoc);
 }
 
-namespace {
-
-void finish_incomplete_transaction(SPDocument &doc) {
+static void finish_incomplete_transaction(SPDocument &doc) {
        SPDocumentPrivate &priv=*doc.priv;
        Inkscape::XML::Event *log=sp_repr_commit_undoable(doc.rdoc);
        if (log || priv.partial) {
@@ -241,8 +240,6 @@ void finish_incomplete_transaction(SPDocument &doc) {
        }
 }
 
-}
-
 gboolean
 sp_document_undo (SPDocument *doc)
 {