mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
fix some crashes
This commit is contained in:
@@ -152,6 +152,7 @@ SipHandler::createPlugin( const QString& factoryId )
|
|||||||
SipPlugin* sip = m_pluginFactories[ factoryId ]->createPlugin();
|
SipPlugin* sip = m_pluginFactories[ factoryId ]->createPlugin();
|
||||||
hookUpPlugin( sip );
|
hookUpPlugin( sip );
|
||||||
|
|
||||||
|
emit pluginAdded( sip );
|
||||||
return sip;
|
return sip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,6 +166,7 @@ SipHandler::loadPlugin( const QString& pluginId )
|
|||||||
SipPlugin* sip = m_pluginFactories[ factoryName ]->createPlugin( pluginId );
|
SipPlugin* sip = m_pluginFactories[ factoryName ]->createPlugin( pluginId );
|
||||||
hookUpPlugin( sip );
|
hookUpPlugin( sip );
|
||||||
|
|
||||||
|
// caller responsible for calling pluginAdded()
|
||||||
return sip;
|
return sip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,8 +196,6 @@ SipHandler::hookUpPlugin( SipPlugin* sip )
|
|||||||
|
|
||||||
QObject::connect( sip, SIGNAL( avatarReceived( QString, QPixmap ) ), SLOT( onAvatarReceived( QString, QPixmap ) ) );
|
QObject::connect( sip, SIGNAL( avatarReceived( QString, QPixmap ) ), SLOT( onAvatarReceived( QString, QPixmap ) ) );
|
||||||
QObject::connect( sip, SIGNAL( avatarReceived( QPixmap ) ), SLOT( onAvatarReceived( QPixmap ) ) );
|
QObject::connect( sip, SIGNAL( avatarReceived( QPixmap ) ), SLOT( onAvatarReceived( QPixmap ) ) );
|
||||||
|
|
||||||
emit pluginAdded( sip );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -537,7 +537,7 @@ SettingsDialog::sipFactoryClicked( SipPluginFactory* factory )
|
|||||||
added = true;
|
added = true;
|
||||||
} else {
|
} else {
|
||||||
// canceled, delete it
|
// canceled, delete it
|
||||||
delete p;
|
added = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// no config, so just add it
|
// no config, so just add it
|
||||||
@@ -560,6 +560,8 @@ SettingsDialog::sipFactoryClicked( SipPluginFactory* factory )
|
|||||||
}
|
}
|
||||||
if( toremove )
|
if( toremove )
|
||||||
ui->addSipButton->removeAction( toremove );
|
ui->addSipButton->removeAction( toremove );
|
||||||
|
} else if( added == false ) { // user pressed cancel
|
||||||
|
delete p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user