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

Fixed double call to slotAddempty when using type and loadsaveinterface at the same time.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8343 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f177fe79
...@@ -927,10 +927,12 @@ void Core::loadPlugin(QString filename, bool silent){ ...@@ -927,10 +927,12 @@ void Core::loadPlugin(QString filename, bool silent){
connect(plugin , SIGNAL( copyObject( int, int& )) , connect(plugin , SIGNAL( copyObject( int, int& )) ,
this , SLOT( slotCopyObject( int, int&) ),Qt::DirectConnection); this , SLOT( slotCopyObject( int, int&) ),Qt::DirectConnection);
// Plugins to core
if ( checkSignal(plugin,"emptyObjectAdded(int)" ) ) if ( checkSignal(plugin,"emptyObjectAdded(int)" ) )
connect(plugin , SIGNAL( emptyObjectAdded( int ) ) , connect(plugin , SIGNAL( emptyObjectAdded( int ) ) ,
this , SLOT( slotEmptyObjectAdded ( int ) ),Qt::DirectConnection); this , SLOT( slotEmptyObjectAdded ( int ) ),Qt::DirectConnection);
// core to plugins
if ( checkSlot(plugin,"addedEmptyObject(int)" ) ) if ( checkSlot(plugin,"addedEmptyObject(int)" ) )
connect(this , SIGNAL( emptyObjectAdded( int ) ) , connect(this , SIGNAL( emptyObjectAdded( int ) ) ,
plugin , SLOT( addedEmptyObject( int ) ),Qt::DirectConnection); plugin , SLOT( addedEmptyObject( int ) ),Qt::DirectConnection);
...@@ -1167,8 +1169,8 @@ void Core::loadPlugin(QString filename, bool silent){ ...@@ -1167,8 +1169,8 @@ void Core::loadPlugin(QString filename, bool silent){
// Add type info // Add type info
supportedDataTypes_.push_back(dt); supportedDataTypes_.push_back(dt);
// Connect signals // Connect signals ( But only if we not already connected in in the loadsave interface )
if ( checkSignal(plugin,"emptyObjectAdded(int)" ) ) if ( !LoadSavePlugin && checkSignal(plugin,"emptyObjectAdded(int)" ) )
connect(plugin , SIGNAL( emptyObjectAdded( int ) ) , connect(plugin , SIGNAL( emptyObjectAdded( int ) ) ,
this , SLOT( slotEmptyObjectAdded ( int ) ),Qt::DirectConnection); this , SLOT( slotEmptyObjectAdded ( int ) ),Qt::DirectConnection);
} }
......
...@@ -307,7 +307,7 @@ int Core::addEmptyObject( DataType _type ) { ...@@ -307,7 +307,7 @@ int Core::addEmptyObject( DataType _type ) {
// File plugins // File plugins
for (int i=0; i < (int)supportedTypes_.size(); i++) for (int i=0; i < (int)supportedTypes_.size(); i++)
if ( supportedTypes_[i].type & _type ) { if ( supportedTypes_[i].type & _type ) {
emit log(LOGERR, tr("File Plugins are not allowed to create empty objects anymore! ") ); emit log(LOGERR, tr("File Plugins are not allowed to create empty objects anymore! Use the addEmpty call instead!") );
retCode = supportedTypes_[i].plugin->addEmpty(); retCode = supportedTypes_[i].plugin->addEmpty();
} }
...@@ -320,6 +320,9 @@ int Core::addEmptyObject( DataType _type ) { ...@@ -320,6 +320,9 @@ int Core::addEmptyObject( DataType _type ) {
/// Slot for adding an empty object of given DataType /// Slot for adding an empty object of given DataType
void Core::slotAddEmptyObject( DataType _type , int& _id ) { void Core::slotAddEmptyObject( DataType _type , int& _id ) {
_id = addEmptyObject( _type );
if ( OpenFlipper::Options::doSlotDebugging() ) { if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) { if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) { if ( sender()->metaObject() != 0 ) {
...@@ -330,8 +333,6 @@ void Core::slotAddEmptyObject( DataType _type , int& _id ) { ...@@ -330,8 +333,6 @@ void Core::slotAddEmptyObject( DataType _type , int& _id ) {
emit log(LOGINFO,"slotAddEmptyObject( " + QString::number(_type) + "," + QString::number(_id) + tr(" ) called by Core") ); emit log(LOGINFO,"slotAddEmptyObject( " + QString::number(_type) + "," + QString::number(_id) + tr(" ) called by Core") );
} }
} }
_id = addEmptyObject( _type );
} }
/// Slot creating a copy of an existing object /// Slot creating a copy of an existing object
......
Supports Markdown
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