From 715d577a38d04a98405a015fd18d49c0fed40c21 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 30 Dec 2009 15:48:50 +0000 Subject: Fix renaming (fix ticket #458). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2324 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/ClientStore.cpp | 8 ++++---- src/client/ObjectModel.cpp | 19 ++++++++++++++++++- src/client/ObjectModel.hpp | 4 ++-- 3 files changed, 24 insertions(+), 7 deletions(-) (limited to 'src/client') diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index b0b6bdbf..5f379035 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -253,13 +253,13 @@ void ClientStore::put(const URI& uri, const Resource::Properties& properties) { typedef Resource::Properties::const_iterator iterator; - /*cerr << "CLIENT PUT " << uri << " {" << endl; + cerr << "CLIENT PUT " << uri << " {" << endl; for (iterator i = properties.begin(); i != properties.end(); ++i) cerr << "\t" << i->first << " = " << i->second << " :: " << i->second.type() << endl; - cerr << "}" << endl;*/ + cerr << "}" << endl; bool is_path = Path::is_valid(uri.str()); - bool is_meta = uri.substr(0, 6) == "meta:#"; + bool is_meta = ResourceImpl::is_meta_uri(uri); if (!(is_path || is_meta)) { const URI& type_uri = properties.find("rdf:type")->second.get_uri(); @@ -366,7 +366,7 @@ ClientStore::set_property(const URI& subject_uri, const URI& predicate, const At cerr << "ERROR: Property '" << predicate << "' is invalid" << endl; } else if (subject) { subject->set_property(predicate, value); - } else if (subject_uri.substr(0, 6) == "meta:#") { + } else if (ResourceImpl::is_meta_uri(subject_uri)) { Path instance_path = string("/") + subject_uri.substr(hash + 1); SharedPtr om = PtrCast(subject); if (om) diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index 3ffd96bd..e41be6c9 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -29,7 +29,7 @@ namespace Client { ObjectModel::ObjectModel(const Path& path) : ResourceImpl(path) - , _meta(std::string("meta:#") + path.chop_start("/")) + , _meta(ResourceImpl::meta_uri(path)) , _path(path) { } @@ -103,6 +103,23 @@ ObjectModel::set(SharedPtr o) } +void +ObjectModel::set_path(const Raul::Path& p) +{ + _path = p; + _meta.set_uri(ResourceImpl::meta_uri(_path)); + signal_moved.emit(); +} + + +void +ObjectModel::set_parent(SharedPtr p) +{ + assert(p); + _parent = p; +} + + } // namespace Client } // namespace Ingen diff --git a/src/client/ObjectModel.hpp b/src/client/ObjectModel.hpp index 72692d65..9b0544f6 100644 --- a/src/client/ObjectModel.hpp +++ b/src/client/ObjectModel.hpp @@ -82,8 +82,8 @@ protected: ObjectModel(const Raul::Path& path); - virtual void set_path(const Raul::Path& p) { _path = p; signal_moved.emit(); } - virtual void set_parent(SharedPtr p) { assert(p); _parent = p; } + virtual void set_path(const Raul::Path& p); + virtual void set_parent(SharedPtr p); virtual void add_child(SharedPtr c) {} virtual bool remove_child(SharedPtr c) { return true; } -- cgit v1.2.1