Commit 561f5e15 authored by Jan Möbius's avatar Jan Möbius

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 b86e6ff4
......@@ -927,10 +927,12 @@ void Core::loadPlugin(QString filename, bool silent){
connect(plugin , SIGNAL( copyObject( int, int& )) ,
this , SLOT( slotCopyObject( int, int&) ),Qt::DirectConnection);
// Plugins to core
if ( checkSignal(plugin,"emptyObjectAdded(int)" ) )
connect(plugin , SIGNAL( emptyObjectAdded( int ) ) ,
this , SLOT( slotEmptyObjectAdded ( int ) ),Qt::DirectConnection);
// core to plugins
if ( checkSlot(plugin,"addedEmptyObject(int)" ) )
connect(this , SIGNAL( emptyObjectAdded( int ) ) ,
plugin , SLOT( addedEmptyObject( int ) ),Qt::DirectConnection);
......@@ -1167,8 +1169,8 @@ void Core::loadPlugin(QString filename, bool silent){
// Add type info
supportedDataTypes_.push_back(dt);
// Connect signals
if ( checkSignal(plugin,"emptyObjectAdded(int)" ) )
// Connect signals ( But only if we not already connected in in the loadsave interface )
if ( !LoadSavePlugin && checkSignal(plugin,"emptyObjectAdded(int)" ) )
connect(plugin , SIGNAL( emptyObjectAdded( int ) ) ,
this , SLOT( slotEmptyObjectAdded ( int ) ),Qt::DirectConnection);
}
......
......@@ -307,7 +307,7 @@ int Core::addEmptyObject( DataType _type ) {
// File plugins
for (int i=0; i < (int)supportedTypes_.size(); i++)
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();
}
......@@ -320,6 +320,9 @@ int Core::addEmptyObject( DataType _type ) {
/// Slot for adding an empty object of given DataType
void Core::slotAddEmptyObject( DataType _type , int& _id ) {
_id = addEmptyObject( _type );
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
......@@ -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") );
}
}
_id = addEmptyObject( _type );
}
/// Slot creating a copy of an existing 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