From 470936f0bf3535c688df5551025265916a5dee06 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 26 Mar 2017 13:49:14 +0200 Subject: Remove Node::set_path() method --- ingen/Node.hpp | 3 --- ingen/client/ObjectModel.hpp | 2 +- src/Store.cpp | 2 +- src/client/ObjectModel.cpp | 8 ++++---- src/server/NodeImpl.hpp | 11 ++++------- 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/ingen/Node.hpp b/ingen/Node.hpp index 18987749..e0fcf338 100644 --- a/ingen/Node.hpp +++ b/ingen/Node.hpp @@ -76,9 +76,6 @@ public: virtual const Raul::Symbol& symbol() const = 0; protected: - friend class Store; - virtual void set_path(const Raul::Path& p) = 0; - Node(const URIs& uris, const Raul::Path& path) : Resource(uris, path_to_uri(path)) {} diff --git a/ingen/client/ObjectModel.hpp b/ingen/client/ObjectModel.hpp index e1cac51b..866f1b46 100644 --- a/ingen/client/ObjectModel.hpp +++ b/ingen/client/ObjectModel.hpp @@ -84,7 +84,7 @@ protected: ObjectModel(URIs& uris, const Raul::Path& path); ObjectModel(const ObjectModel& copy); - virtual void set_path(const Raul::Path& p); + virtual void set_uri(const Raul::URI& uri); virtual void set_parent(SPtr p); virtual void add_child(SPtr c) {} virtual bool remove_child(SPtr c) { return true; } diff --git a/src/Store.cpp b/src/Store.cpp index 1767b4f5..2c7294a8 100644 --- a/src/Store.cpp +++ b/src/Store.cpp @@ -109,7 +109,7 @@ Store::rename(const iterator top, const Raul::Path& new_path) : new_path.child( Raul::Path(i->first.substr(old_path.base().length() - 1))); - i->second->set_path(path); + i->second->set_uri(path_to_uri(path)); assert(find(path) == end()); // Shouldn't be dropping objects! insert(make_pair(path, i->second)); } diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index 94106027..4061b863 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -92,11 +92,11 @@ ObjectModel::set(SPtr o) } void -ObjectModel::set_path(const Raul::Path& p) +ObjectModel::set_uri(const Raul::URI& uri) { - _path = p; - _symbol = Raul::Symbol(p.is_root() ? "root" : p.symbol()); - set_uri(path_to_uri(p)); + _path = uri_to_path(uri); + _symbol = Raul::Symbol(_path.is_root() ? "main" : _path.symbol()); + Node::set_uri(uri); _signal_moved.emit(); } diff --git a/src/server/NodeImpl.hpp b/src/server/NodeImpl.hpp index 8e3795d3..f4de621e 100644 --- a/src/server/NodeImpl.hpp +++ b/src/server/NodeImpl.hpp @@ -57,13 +57,10 @@ public: BlockImpl* parent() { return _parent; } /** Rename */ - virtual void set_path(const Raul::Path& new_path) { - _path = new_path; - const char* const new_sym = new_path.symbol(); - if (new_sym[0] != '\0') { - _symbol = Raul::Symbol(new_sym); - } - set_uri(path_to_uri(new_path)); + void set_uri(const Raul::URI& uri) override { + _path = uri_to_path(uri); + _symbol = Raul::Symbol(_path.is_root() ? "main" : _path.symbol()); + Node::set_uri(uri); } const Atom& get_property(const Raul::URI& key) const; -- cgit v1.2.1