Commit 10ca4e9e authored by Jan Möbius's avatar Jan Möbius
Browse files

objectProperties changed is now handled internally from core

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7934 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 36583eee
...@@ -386,7 +386,6 @@ void DataControlPlugin::slotDataChanged ( int _id, int _column, const QVariant& ...@@ -386,7 +386,6 @@ void DataControlPlugin::slotDataChanged ( int _id, int _column, const QVariant&
// Name // Name
case 0: case 0:
obj->setName( _value.toString() ); obj->setName( _value.toString() );
emit objectPropertiesChanged( obj->id() );
break; break;
// show/hide // show/hide
...@@ -431,15 +430,8 @@ void DataControlPlugin::slotMoveBaseObject(int _id, int _newParentId){ ...@@ -431,15 +430,8 @@ void DataControlPlugin::slotMoveBaseObject(int _id, int _newParentId){
BaseObject* oldParent = obj->parent(); BaseObject* oldParent = obj->parent();
//remove from old parent
oldParent->removeChild( obj );
//set new parent //set new parent
obj->setParent( parent ); obj->setParent( parent );
parent->appendChild( obj );
// and inform everyone that the parent changed
emit objectPropertiesChanged( _id );
//if oldParent is an empty group -> delete it //if oldParent is an empty group -> delete it
if ( oldParent != PluginFunctions::objectRoot() && oldParent->childCount() == 0 ) if ( oldParent != PluginFunctions::objectRoot() && oldParent->childCount() == 0 )
...@@ -530,12 +522,7 @@ void DataControlPlugin::loadIniFileOptionsLast( INIFile& _ini ) { ...@@ -530,12 +522,7 @@ void DataControlPlugin::loadIniFileOptionsLast( INIFile& _ini ) {
for ( int i = 0 ; i < elementChildren.size() ; ++i ) { for ( int i = 0 ; i < elementChildren.size() ; ++i ) {
BaseObject* childItem = PluginFunctions::objectRoot()->childExists( elementChildren[i] ); BaseObject* childItem = PluginFunctions::objectRoot()->childExists( elementChildren[i] );
if ( childItem ) { if ( childItem ) {
childItem->parent()->removeChild(childItem);
childItem->setParent(group); childItem->setParent(group);
group->appendChild(childItem);
//inform everyone that the parent changed
emit objectPropertiesChanged( childItem->id() );
} }
} }
} }
......
...@@ -80,7 +80,6 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn ...@@ -80,7 +80,6 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
// BaseInterface // BaseInterface
void updateView(); void updateView();
void updatedObject(int); void updatedObject(int);
void objectPropertiesChanged(int);
void setSlotDescription(QString _slotName, QString _slotDescription, void setSlotDescription(QString _slotName, QString _slotDescription,
QStringList _parameters, QStringList _descriptions); QStringList _parameters, QStringList _descriptions);
......
...@@ -224,8 +224,6 @@ void DataControlPlugin::setObjectName( int objectId, QString _name ) { ...@@ -224,8 +224,6 @@ void DataControlPlugin::setObjectName( int objectId, QString _name ) {
BaseObjectData* object; BaseObjectData* object;
if ( PluginFunctions::getObject(objectId,object) ){ if ( PluginFunctions::getObject(objectId,object) ){
object->setName( _name ); object->setName( _name );
emit objectPropertiesChanged( object->id() );
} }
} }
...@@ -324,20 +322,13 @@ int DataControlPlugin::groupObjects(IdList _objectIDs, QString _groupName) { ...@@ -324,20 +322,13 @@ int DataControlPlugin::groupObjects(IdList _objectIDs, QString _groupName) {
//append new children to group //append new children to group
for ( int i = 0 ; i < objs.size() ; ++i) { for ( int i = 0 ; i < objs.size() ; ++i) {
(objs[i])->parent()->removeChild( objs[i] );
(objs[i])->setParent( dynamic_cast< BaseObject* >( groupItem ) ); (objs[i])->setParent( dynamic_cast< BaseObject* >( groupItem ) );
groupItem->appendChild( objs[i] );
//inform everyone that the parent changed
emit objectPropertiesChanged( (objs[i])->id() );
} }
//update target/source state //update target/source state
groupItem->visible(visible); groupItem->visible(visible);
groupItem->target(target); groupItem->target(target);
groupItem->source(source); groupItem->source(source);
emit objectPropertiesChanged( groupItem->id() );
return groupItem->id(); return groupItem->id();
} }
......
...@@ -118,15 +118,8 @@ void DataControlPlugin::slotUngroup ( ) { ...@@ -118,15 +118,8 @@ void DataControlPlugin::slotUngroup ( ) {
for (int i=group->childCount()-1; i >= 0; i--){ for (int i=group->childCount()-1; i >= 0; i--){
BaseObject* child = group->child(i); BaseObject* child = group->child(i);
// remove it from the old parent
group->removeChild( child );
// then change the parent // then change the parent
child->setParent(group->parent()); child->setParent(group->parent());
child->parent()->appendChild( child );
// and inform everyone that the parent changed
emit objectPropertiesChanged( child->id() );
} }
//delete the group //delete the group
...@@ -234,20 +227,13 @@ void DataControlPlugin::slotGroup() { ...@@ -234,20 +227,13 @@ void DataControlPlugin::slotGroup() {
PluginFunctions::getObject(id, item ); PluginFunctions::getObject(id, item );
//and move it into the group //and move it into the group
item->parent()->removeChild(item);
item->setParent( dynamic_cast< BaseObject* >( groupItem ) ); item->setParent( dynamic_cast< BaseObject* >( groupItem ) );
groupItem->appendChild(item);
//inform everyone that the parent changed
emit objectPropertiesChanged( id );
} }
//update target/source state //update target/source state
groupItem->visible(visible); groupItem->visible(visible);
groupItem->target(target); groupItem->target(target);
groupItem->source(source); groupItem->source(source);
emit objectPropertiesChanged( groupItem->id() );
} }
...@@ -451,7 +437,6 @@ void DataControlPlugin::slotRename(){ ...@@ -451,7 +437,6 @@ void DataControlPlugin::slotRename(){
item->name(), &ok); item->name(), &ok);
if (ok && !newName.isEmpty()){ if (ok && !newName.isEmpty()){
item->setName(newName); item->setName(newName);
emit objectPropertiesChanged( item->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