From db2f1ecbb69f329f79b1965a3edb627ed8d3f157 Mon Sep 17 00:00:00 2001 From: Dirk Wilden Date: Wed, 9 Dec 2009 13:30:12 +0000 Subject: [PATCH] adjusted DataControl to new visibility/selection handling git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7820 383ad7c9-94d9-4d36-a494-682f7c89f535 --- Core/PluginCommunication.cc | 4 ++-- Core/PluginLoader.cc | 2 +- common/BaseObject.cc | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Core/PluginCommunication.cc b/Core/PluginCommunication.cc index 016788e7..ea52f843 100644 --- a/Core/PluginCommunication.cc +++ b/Core/PluginCommunication.cc @@ -282,8 +282,8 @@ void Core::newObject(int _objectId) { PluginFunctions::getObject(_objectId,baseObject); if ( baseObject ) { - connect( baseObject, SIGNAL(visibilityChanged(int)), this, SLOT(slotVisibilityChanged(int))) ; - connect( baseObject, SIGNAL(objectSelectionChanged(int)),this, SLOT(slotObjectSelectionChanged(int)) ); + connect( baseObject, SIGNAL(visibilityChanged(int)), this, SLOT(slotVisibilityChanged(int)), Qt::DirectConnection) ; + connect( baseObject, SIGNAL(objectSelectionChanged(int)),this, SLOT(slotObjectSelectionChanged(int)), Qt::DirectConnection ); } else { emit log(LOGERR,tr("newObject received from objectManager with invalid id! This should not happen. The new Object will not work correctly!")); } diff --git a/Core/PluginLoader.cc b/Core/PluginLoader.cc index 5593ebcd..e10756eb 100644 --- a/Core/PluginLoader.cc +++ b/Core/PluginLoader.cc @@ -530,7 +530,7 @@ void Core::loadPlugin(QString filename, bool silent){ } if ( checkSlot( plugin , "slotObjectSelectionChanged(int)" ) ) - connect(this,SIGNAL(objectSelectionChanged(int)),plugin,SLOT(slotObjectSelectionChanged(int) )); + connect(this,SIGNAL(objectSelectionChanged(int)),plugin,SLOT(slotObjectSelectionChanged(int) ), Qt::DirectConnection); if ( checkSlot( plugin , "pluginsInitialized()" ) ) diff --git a/common/BaseObject.cc b/common/BaseObject.cc index cc57adb2..42dd2524 100644 --- a/common/BaseObject.cc +++ b/common/BaseObject.cc @@ -249,11 +249,14 @@ bool BaseObject::flag(QString _flag) void BaseObject::setFlag(QString _flag, bool _set) { + bool emitted = false; + if (flags_.contains(_flag)) { if (!_set) { flags_.removeAll(_flag); emit objectSelectionChanged(id()); + emitted = true; } } else @@ -261,9 +264,13 @@ void BaseObject::setFlag(QString _flag, bool _set) if (_set) { flags_ << _flag; emit objectSelectionChanged(id()); + emitted = true; } } + //always emit if its a group + if ( !emitted && isGroup() ) + emit objectSelectionChanged(id()); } QStringList BaseObject::flags() @@ -283,8 +290,15 @@ void BaseObject::visible(bool _visible) { // Only do something if this is really a change if ( visible_ != _visible ) { visible_ = _visible; + + emit visibilityChanged( id() ); + + } else { + + //always emit if its a group + if ( isGroup() ) + emit visibilityChanged( id() ); } - emit visibilityChanged( id() ); } // =============================================================================== -- GitLab