summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/debug/timestamp.cpp9
-rw-r--r--src/debug/timestamp.h5
-rw-r--r--src/document-undo.cpp2
-rw-r--r--src/helper/action.cpp2
4 files changed, 10 insertions, 8 deletions
diff --git a/src/debug/timestamp.cpp b/src/debug/timestamp.cpp
index e22f8dede..619c4a18a 100644
--- a/src/debug/timestamp.cpp
+++ b/src/debug/timestamp.cpp
@@ -13,6 +13,8 @@
#include <glib.h>
#include <glibmm/ustring.h>
+#include <memory>
+#include <string>
#include "debug/simple-event.h"
#include "timestamp.h"
@@ -20,14 +22,13 @@ namespace Inkscape {
namespace Debug {
-Util::ptr_shared timestamp() {
- Util::ptr_shared result;
+std::shared_ptr<std::string> timestamp() {
GTimeVal timestamp;
g_get_current_time(&timestamp);
gchar *value = g_strdup_printf( "%d.%06d", static_cast<gint>(timestamp.tv_sec), static_cast<gint>(timestamp.tv_usec) );
- result = Util::share_string(value);
+ std::shared_ptr<std::string> result = std::make_shared<std::string>(value);
g_free(value);
- return result;
+ return std::move(result);
}
}
diff --git a/src/debug/timestamp.h b/src/debug/timestamp.h
index 281c31b4c..a4db90dc6 100644
--- a/src/debug/timestamp.h
+++ b/src/debug/timestamp.h
@@ -13,13 +13,14 @@
#ifndef SEEN_INKSCAPE_DEBUG_TIMESTAMP_H
#define SEEN_INKSCAPE_DEBUG_TIMESTAMP_H
-#include "util/share.h"
+#include <memory>
+#include <string>
namespace Inkscape {
namespace Debug {
-Util::ptr_shared timestamp();
+std::shared_ptr<std::string> timestamp();
}
diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index 23650dc9c..8284dac55 100644
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
@@ -109,7 +109,7 @@ public:
CommitEvent(SPDocument *doc, const gchar *key, const unsigned int type)
: InteractionEvent("commit")
{
- _addProperty("timestamp", timestamp().pointer());
+ _addProperty("timestamp", timestamp());
_addProperty("document", doc->serial());
Verb *verb = Verb::get(type);
if (verb) {
diff --git a/src/helper/action.cpp b/src/helper/action.cpp
index 2859f6273..2bad8f8ea 100644
--- a/src/helper/action.cpp
+++ b/src/helper/action.cpp
@@ -114,7 +114,7 @@ public:
ActionEvent(SPAction const *action)
: ActionEventBase("action")
{
- _addProperty("timestamp", timestamp().pointer());
+ _addProperty("timestamp", timestamp());
SPDocument *document = action->context.getDocument();
if (document) {
_addProperty("document", document->serial());