From ff30d84483a8c33af8603bfac5d149bc4d63bfb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20M=C3=B6bius?= <moebius@cs.rwth-aachen.de>
Date: Tue, 15 Dec 2009 12:57:12 +0000
Subject: [PATCH] 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
---
 DataControlPlugin.cc          | 13 -------------
 DataControlPlugin.hh          |  1 -
 DataControlPluginScripting.cc |  9 ---------
 Popup.cc                      | 15 ---------------
 4 files changed, 38 deletions(-)

diff --git a/DataControlPlugin.cc b/DataControlPlugin.cc
index 8398944..3862003 100644
--- a/DataControlPlugin.cc
+++ b/DataControlPlugin.cc
@@ -386,7 +386,6 @@ void DataControlPlugin::slotDataChanged ( int _id, int _column, const QVariant&
     // Name
     case 0:
       obj->setName( _value.toString() );
-      emit objectPropertiesChanged( obj->id() );
       break;
 
     // show/hide
@@ -431,15 +430,8 @@ void DataControlPlugin::slotMoveBaseObject(int _id, int _newParentId){
 
   BaseObject* oldParent = obj->parent();
 
-  //remove from old parent
-  oldParent->removeChild( obj );
-
   //set new 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 != PluginFunctions::objectRoot() && oldParent->childCount() == 0 )
@@ -530,12 +522,7 @@ void DataControlPlugin::loadIniFileOptionsLast( INIFile& _ini ) {
     for ( int i = 0 ; i < elementChildren.size() ; ++i ) {
       BaseObject* childItem =  PluginFunctions::objectRoot()->childExists( elementChildren[i] );
       if ( childItem ) {
-        childItem->parent()->removeChild(childItem);
         childItem->setParent(group);
-        group->appendChild(childItem);
-
-        //inform everyone that the parent changed
-        emit objectPropertiesChanged( childItem->id() );
       }
     }
   }
diff --git a/DataControlPlugin.hh b/DataControlPlugin.hh
index 67d1d05..1cbb184 100644
--- a/DataControlPlugin.hh
+++ b/DataControlPlugin.hh
@@ -80,7 +80,6 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
     // BaseInterface
     void updateView();
     void updatedObject(int);
-    void objectPropertiesChanged(int);
 
     void setSlotDescription(QString     _slotName,   QString     _slotDescription,
                             QStringList _parameters, QStringList _descriptions);
diff --git a/DataControlPluginScripting.cc b/DataControlPluginScripting.cc
index 78ed46c..ee692a3 100644
--- a/DataControlPluginScripting.cc
+++ b/DataControlPluginScripting.cc
@@ -224,8 +224,6 @@ void DataControlPlugin::setObjectName( int objectId, QString _name ) {
   BaseObjectData* object;
   if ( PluginFunctions::getObject(objectId,object) ){
     object->setName( _name );
-
-    emit objectPropertiesChanged( object->id() );
   }
 }
 
@@ -324,20 +322,13 @@ int DataControlPlugin::groupObjects(IdList _objectIDs, QString _groupName) {
 
   //append new children to group
   for ( int i = 0 ; i < objs.size() ; ++i) {
-    (objs[i])->parent()->removeChild( objs[i] );
     (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
   groupItem->visible(visible);
   groupItem->target(target);
   groupItem->source(source);
-
-  emit objectPropertiesChanged( groupItem->id() );
   
   return groupItem->id();
 }
diff --git a/Popup.cc b/Popup.cc
index 2381933..cffd07b 100644
--- a/Popup.cc
+++ b/Popup.cc
@@ -118,15 +118,8 @@ void DataControlPlugin::slotUngroup (  ) {
     for (int i=group->childCount()-1; i >= 0; i--){
       BaseObject* child = group->child(i);
 
-      // remove it from the old parent
-      group->removeChild( child );
-
       // then change the parent
       child->setParent(group->parent());
-      child->parent()->appendChild( child );
-
-      // and inform everyone that the parent changed
-      emit objectPropertiesChanged( child->id() );
     }
 
     //delete the group
@@ -234,20 +227,13 @@ void DataControlPlugin::slotGroup() {
     PluginFunctions::getObject(id, item );
 
     //and move it into the group
-    item->parent()->removeChild(item);
     item->setParent( dynamic_cast< BaseObject* >( groupItem )  );
-    groupItem->appendChild(item);
-
-    //inform everyone that the parent changed
-    emit objectPropertiesChanged( id );
   }
 
   //update target/source state
   groupItem->visible(visible);
   groupItem->target(target);
   groupItem->source(source);
-
-  emit objectPropertiesChanged( groupItem->id() );
 }
 
 
@@ -451,7 +437,6 @@ void DataControlPlugin::slotRename(){
                                               item->name(), &ok);
       if (ok && !newName.isEmpty()){
         item->setName(newName);
-        emit objectPropertiesChanged( item->id() );
       }
     }
   }
-- 
GitLab