Commit db2f1ecb authored by Dirk Wilden's avatar Dirk Wilden

adjusted DataControl to new visibility/selection handling

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7820 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8bcc01d8
......@@ -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!"));
}
......
......@@ -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()" ) )
......
......@@ -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() );
}
// ===============================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment