summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d5a0cb1)
raw | patch | inline | side by side (parent: d5a0cb1)
author | mental <mental@users.sourceforge.net> | |
Thu, 10 May 2007 01:18:16 +0000 (01:18 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Thu, 10 May 2007 01:18:16 +0000 (01:18 +0000) |
src/document-private.h | patch | blob | history | |
src/document-undo.cpp | patch | blob | history | |
src/document.cpp | patch | blob | history | |
src/document.h | patch | blob | history |
diff --git a/src/document-private.h b/src/document-private.h
index 1c03a8025d44ec3a9349bc14a648aefc82c9d444..fa4754248f082b84ff2eea883dd0bec593da7977 100644 (file)
--- a/src/document-private.h
+++ b/src/document-private.h
GHashTable *iddef; /**< Dictionary of id -> SPObject mappings */
GHashTable *reprdef; /**< Dictionary of Inkscape::XML::Node -> SPObject mappings */
+ unsigned long serial;
+
/** Dictionary of signals for id changes */
IDChangedSignalMap id_changed_signals;
diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index 8f1dd90ce08af65128990a06dafd8cd4975dee6a..0f0a606a1253237954f69e3ddd462150c3ec4c90 100644 (file)
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
: InteractionEvent(share_static_string("commit"))
{
_addProperty(share_static_string("timestamp"), timestamp());
+ gchar *serial = g_strdup_printf("%ul", 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());
diff --git a/src/document.cpp b/src/document.cpp
index a61dffc0b4a1c3fd78d7a9045dc88c51dcc1ab86..6ab08ffb62c7b5165bd38baee66bdcb09cd1ae2c 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
static gint doc_count = 0;
+static unsigned long next_serial = 0;
+
SPDocument::SPDocument() {
SPDocumentPrivate *p;
p = new SPDocumentPrivate();
+ p->serial = next_serial++;
+
p->iddef = g_hash_table_new(g_direct_hash, g_direct_equal);
p->reprdef = g_hash_table_new(g_direct_hash, g_direct_equal);
//delete this->_whiteboard_session_manager;
}
+unsigned long SPDocument::serial() const {
+ return priv->serial;
+}
+
void SPDocument::queueForOrphanCollection(SPObject *object) {
g_return_if_fail(object != NULL);
g_return_if_fail(SP_OBJECT_DOCUMENT(object) == this);
diff --git a/src/document.h b/src/document.h
index a3377f398287ad756e91387114c5aa4764f46c05..d9acc93fc294b6457b8ef897230baaf1b0f9794e 100644 (file)
--- a/src/document.h
+++ b/src/document.h
void emitReconstructionStart (void);
void emitReconstructionFinish (void);
+ unsigned long serial() const;
void reset_key (void *dummy);
sigc::connection _selection_changed_connection;
sigc::connection _desktop_activated_connection;