summaryrefslogtreecommitdiffstats
path: root/src/libs/client/ObjectModel.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-09-18 07:19:42 +0000
committerDavid Robillard <d@drobilla.net>2006-09-18 07:19:42 +0000
commitf0d7a30b0a4d9daeb8db95c59a5b0e836b03b31b (patch)
treedf254e018dbede7f7ef83a70a5f4c0d57102978e /src/libs/client/ObjectModel.cpp
parent6f93b3d7c80f9dee2d95fac1bbc4f781a6f45979 (diff)
downloadingen-f0d7a30b0a4d9daeb8db95c59a5b0e836b03b31b.tar.gz
ingen-f0d7a30b0a4d9daeb8db95c59a5b0e836b03b31b.tar.bz2
ingen-f0d7a30b0a4d9daeb8db95c59a5b0e836b03b31b.zip
More store error correcting fixes.
Working (sometimes...) patch refresh button. git-svn-id: http://svn.drobilla.net/lad/ingen@143 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/ObjectModel.cpp')
-rw-r--r--src/libs/client/ObjectModel.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/libs/client/ObjectModel.cpp b/src/libs/client/ObjectModel.cpp
index e50882ca..50f8b56d 100644
--- a/src/libs/client/ObjectModel.cpp
+++ b/src/libs/client/ObjectModel.cpp
@@ -52,17 +52,18 @@ ObjectModel::add_metadata(const MetadataMap& data)
{
for (MetadataMap::const_iterator i = data.begin(); i != data.end(); ++i) {
_metadata[i->first] = i->second;
+ metadata_update_sig.emit(i->first, i->second);
}
}
/** Merge the data of @a model with self, as much as possible.
*
- * This will merge the two models, but with any conflict take the version in
- * this as correct. The paths of the two models must be equal.
+ * This will merge the two models, but with any conflict take the value in
+ * @a model as correct. The paths of the two models MUST be equal.
*/
void
-ObjectModel::assimilate(CountedPtr<ObjectModel> model)
+ObjectModel::set(CountedPtr<ObjectModel> model)
{
assert(_path == model->path());
@@ -71,8 +72,13 @@ ObjectModel::assimilate(CountedPtr<ObjectModel> model)
MetadataMap::const_iterator mine = _metadata.find(other->first);
- if (mine == _metadata.end())
- _metadata[other->first] = other->second;
+ if (mine != _metadata.end()) {
+ cerr << "WARNING: " << _path << "Client/Server data mismatch: " << other->first << endl;
+ cerr << "Setting server value " << other->second;
+ }
+
+ _metadata[other->first] = other->second;
+ metadata_update_sig.emit(other->first, other->second);
}
}