summaryrefslogtreecommitdiffstats
path: root/src/debug/simple-event.h
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2019-01-23 03:57:42 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2019-01-24 17:08:27 +0000
commitfae3e6149995446aad42fd78b4c69a9e34027aae (patch)
tree457ec878f41accfe9af46b02667c1a96e28b1b5a /src/debug/simple-event.h
parentEvent: Make name and property name char const*. (diff)
downloadinkscape-fae3e6149995446aad42fd78b4c69a9e34027aae.tar.gz
inkscape-fae3e6149995446aad42fd78b4c69a9e34027aae.zip
Event: Make property value char const* too.
Diffstat (limited to 'src/debug/simple-event.h')
-rw-r--r--src/debug/simple-event.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/debug/simple-event.h b/src/debug/simple-event.h
index 70bef77e9..1b6dc172c 100644
--- a/src/debug/simple-event.h
+++ b/src/debug/simple-event.h
@@ -14,6 +14,8 @@
#define SEEN_INKSCAPE_DEBUG_SIMPLE_EVENT_H
#include <cstdarg>
+#include <memory>
+#include <string>
#include <vector>
#include <glib.h> // g_assert()
@@ -43,11 +45,15 @@ public:
void generateChildEvents() const override {}
protected:
+ // TODO: change all call sites for this method, and remove it.
void _addProperty(char const *name, Util::ptr_shared value) {
- _properties.push_back(PropertyPair(name, value));
+ _properties.push_back(PropertyPair(name, std::move(std::make_shared<std::string>(value.pointer()))));
+ }
+ void _addProperty(char const *name, std::shared_ptr<std::string>&& value) {
+ _properties.push_back(PropertyPair(name, std::move(value)));
}
void _addProperty(char const *name, char const *value) {
- _addProperty(name, Util::share_string(value));
+ _addProperty(name, std::move(std::make_shared<std::string>(value)));
}
void _addProperty(char const *name, long value) {
_addFormattedProperty(name, "%ld", value);
@@ -55,7 +61,7 @@ protected:
private:
char const *_name;
- std::vector<PropertyPair, GC::Alloc<PropertyPair, GC::AUTO> > _properties;
+ std::vector<PropertyPair> _properties;
void _addFormattedProperty(char const *name, char const *format, ...)
{