diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index 9ce1dad603fa8f59af769b9aef213d579b989939..7556d2e8fed7df52a16ad5c00f551d8a006b62af 100644 (file)
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
#include "inkscape.h"
#include "debug/event-tracker.h"
#include "debug/simple-event.h"
#include "inkscape.h"
#include "debug/event-tracker.h"
#include "debug/simple-event.h"
+#include "debug/timestamp.h"
#include "event.h"
#include "event.h"
@@ -123,10 +124,42 @@ sp_document_done (SPDocument *doc, const unsigned int event_type, Glib::ustring
}
void
}
void
-sp_document_reset_key (Inkscape::Application *inkscape, SPDesktop *desktop, GtkObject *base)
+sp_document_reset_key (Inkscape::Application */*inkscape*/, SPDesktop */*desktop*/, GtkObject *base)
{
{
- SPDocument *doc = (SPDocument *) base;
- doc->actionkey = NULL;
+ SPDocument *doc = (SPDocument *) base;
+ doc->actionkey = NULL;
+}
+
+namespace {
+
+using Inkscape::Debug::Event;
+using Inkscape::Debug::SimpleEvent;
+using Inkscape::Util::share_static_string;
+using Inkscape::Debug::timestamp;
+using Inkscape::Verb;
+
+typedef SimpleEvent<Event::INTERACTION> InteractionEvent;
+
+class CommitEvent : public InteractionEvent {
+public:
+
+ 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("context"), verb->get_id());
+ }
+ if (key) {
+ _addProperty(share_static_string("merge-key"), key);
+ }
+ }
+};
+
}
void
}
void
@@ -137,6 +170,8 @@ sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int ev
g_assert (doc->priv != NULL);
g_assert (doc->priv->sensitive);
g_assert (doc->priv != NULL);
g_assert (doc->priv->sensitive);
+ Inkscape::Debug::EventTracker<CommitEvent> tracker(doc, key, event_type);
+
doc->collectOrphans();
sp_document_ensure_up_to_date (doc);
doc->collectOrphans();
sp_document_ensure_up_to_date (doc);
sp_repr_begin_transaction (doc->rdoc);
}
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) {
SPDocumentPrivate &priv=*doc.priv;
Inkscape::XML::Event *log=sp_repr_commit_undoable(doc.rdoc);
if (log || priv.partial) {
}
}
}
}
-}
-
gboolean
sp_document_undo (SPDocument *doc)
{
gboolean
sp_document_undo (SPDocument *doc)
{