Commit 37b23aa4 authored by Jan Möbius's avatar Jan Möbius

Renamed updatedObjects stuff internally in Core

Call object->update in updated object when specific id is given

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4169 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 1ad3002a
......@@ -649,7 +649,7 @@ Core::clearAll()
{
objectRoot_->deleteSubtree();
emit allCleared();
emit ObjectListUpdated(-1);
emit signalObjectUpdated(-1);
slotScriptInfo( "core" , "clearAll()" );
}
......
......@@ -136,7 +136,7 @@ signals:
void allCleared();
/// When this Signal is emitted all Plugins are informed that the object list changed
void ObjectListUpdated(int);
void signalObjectUpdated(int);
/// When this Signal is emitted when a Wheel Event occures
void PluginWheelEvent(QWheelEvent * , const std::string & );
......@@ -200,7 +200,7 @@ signals:
/** Called by the plugins if they changed something in the object list (deleted, added,...)
* @param _identifier Id of the object
*/
void slotObjectsListUpdated(int _identifier);
void slotObjectUpdated(int _identifier);
/// Called by Plugins if they changed the active object
void slotActiveObjectChanged();
......
......@@ -49,6 +49,8 @@
#include "OpenFlipper/BasePlugin/ToolboxInterface.hh"
#include "OpenFlipper/BasePlugin/TextureInterface.hh"
#include "OpenFlipper/BasePlugin/PluginFunctions.hh"
//== IMPLEMENTATION ==========================================================
//========================================================================================
......@@ -58,7 +60,7 @@
/** This function is called by a plugin if it changed something in the object list (source,target,...). The information is passed to all plugins.
* @param _identifier Id of the updated object
*/
void Core::slotObjectsListUpdated(int _identifier) {
void Core::slotObjectUpdated(int _identifier) {
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
......@@ -68,8 +70,19 @@ void Core::slotObjectsListUpdated(int _identifier) {
}
}
// If we are called for a special object, we update it ourself so the Plugins dont need to do that.
if ( _identifier != -1 ) {
BaseObject* object = 0;
PluginFunctions::get_object(_identifier,object);
if ( !object ) {
emit log(LOGERR,"updated_objects called for non existing object with id : " + QString::number(_identifier) );
return;
}
}
// just inform the plugins as we dont do anything else
emit ObjectListUpdated(_identifier);
emit signalObjectUpdated(_identifier);
}
/** This function is called if the active object has changed. The information is passed to all plugins.
......
......@@ -455,7 +455,7 @@ void Core::loadPlugin(QString filename, bool silent){
connect(plugin,SIGNAL(update_view()),this,SLOT(updateView()));
if ( checkSignal(plugin,"updated_objects(int)") )
connect(plugin,SIGNAL(updated_objects(int)),this,SLOT(slotObjectsListUpdated(int)));
connect(plugin,SIGNAL(updated_objects(int)),this,SLOT(slotObjectUpdated(int)));
if ( checkSlot(plugin,"slotAllCleared()") )
connect(this,SIGNAL(allCleared()),plugin,SLOT(slotAllCleared()));
......@@ -467,7 +467,7 @@ void Core::loadPlugin(QString filename, bool silent){
connect(this,SIGNAL(activeObjectChanged()),plugin,SLOT(slotActiveObjectChanged() ));
if ( checkSlot( plugin , "slotObjectUpdated(int)" ) )
connect(this,SIGNAL(ObjectListUpdated(int)),plugin,SLOT(slotObjectUpdated(int)));
connect(this,SIGNAL(signalObjectUpdated(int)),plugin,SLOT(slotObjectUpdated(int)));
if ( checkSlot( plugin , "pluginsInitialized()" ) )
connect(this,SIGNAL(pluginsInitialized()),plugin,SLOT(pluginsInitialized()), Qt::DirectConnection);
......
......@@ -190,7 +190,7 @@ void Core::slotLoad(QString _filename, DataType _type, int& _id) {
emit openedFile( _id );
// Tell the Plugins that the Object List and the active object have changed
emit ObjectListUpdated(_id);
emit signalObjectUpdated(_id);
emit activeObjectChanged();
backupRequest(_id,"Original Object");
......@@ -213,7 +213,7 @@ void Core::slotLoad(QString _filename, DataType _type, int& _id) {
/// Slot gets called after a file-plugin has opened an object
void Core::slotEmptyObjectAdded ( int _id ) {
// Tell the Plugins that the Object List and the active object have changed
emit ObjectListUpdated(_id);
emit signalObjectUpdated(_id);
emit activeObjectChanged();
backupRequest(_id,"Original Object");
......
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