From e16206982d074e62956de00eeef611478f01c430 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 19 Aug 2008 18:51:06 +0000 Subject: Preliminary connecting via HTTP in Gtk client. Better handling of overflowed client event receive buffer. Store fixes, complain only once about orphans, don't request an orphan parent over and over. git-svn-id: http://svn.drobilla.net/lad/ingen@1447 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/ObjectModel.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/libs/client/ObjectModel.cpp') diff --git a/src/libs/client/ObjectModel.cpp b/src/libs/client/ObjectModel.cpp index e9a491a6..ede5f822 100644 --- a/src/libs/client/ObjectModel.cpp +++ b/src/libs/client/ObjectModel.cpp @@ -119,21 +119,26 @@ ObjectModel::polyphonic() const * @a model as correct. The paths of the two models MUST be equal. */ void -ObjectModel::set(SharedPtr model) +ObjectModel::set(SharedPtr o) { - assert(_path == model->path()); - - for (Variables::const_iterator other = model->variables().begin(); - other != model->variables().end(); ++other) { - - Variables::const_iterator mine = _variables.find(other->first); - - if (mine != _variables.end()) { - cerr << "WARNING: " << _path << "Client/Server data mismatch: " << other->first << endl; - } - - _variables[other->first] = other->second; - signal_variable.emit(other->first, other->second); + assert(_path == o->path()); + if (o->_parent) + _parent = o->_parent; + + for (Variables::const_iterator v = o->variables().begin(); v != o->variables().end(); ++v) { + Variables::const_iterator mine = _variables.find(v->first); + if (mine != _variables.end()) + cerr << "WARNING: " << _path << "Client/Server variable mismatch: " << v->first << endl; + _variables[v->first] = v->second; + signal_variable.emit(v->first, v->second); + } + + for (Properties::const_iterator v = o->properties().begin(); v != o->properties().end(); ++v) { + Properties::const_iterator mine = _properties.find(v->first); + if (mine != _properties.end()) + cerr << "WARNING: " << _path << "Client/Server property mismatch: " << v->first << endl; + _properties[v->first] = v->second; + signal_variable.emit(v->first, v->second); } } -- cgit v1.2.1