summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-03-26 13:49:14 +0200
committerDavid Robillard <d@drobilla.net>2017-03-26 17:02:09 +0200
commit470936f0bf3535c688df5551025265916a5dee06 (patch)
treec52c5ccd41e666ef5737d826e3ee7de0e4aaee15
parentfbb4acda313ecfb69dd1e7c2f1f120072fec382d (diff)
downloadingen-470936f0bf3535c688df5551025265916a5dee06.tar.gz
ingen-470936f0bf3535c688df5551025265916a5dee06.tar.bz2
ingen-470936f0bf3535c688df5551025265916a5dee06.zip
Remove Node::set_path() method
-rw-r--r--ingen/Node.hpp3
-rw-r--r--ingen/client/ObjectModel.hpp2
-rw-r--r--src/Store.cpp2
-rw-r--r--src/client/ObjectModel.cpp8
-rw-r--r--src/server/NodeImpl.hpp11
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<ObjectModel> p);
virtual void add_child(SPtr<ObjectModel> c) {}
virtual bool remove_child(SPtr<ObjectModel> 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<ObjectModel> 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;