small cleanup
This commit is contained in:
parent
de7993413d
commit
7e903ad093
|
@ -72,6 +72,11 @@ SnorePlugin *PluginContainer::load()
|
||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PluginContainer::unload()
|
||||||
|
{
|
||||||
|
m_instance->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
const QString & PluginContainer::file()
|
const QString & PluginContainer::file()
|
||||||
{
|
{
|
||||||
return m_pluginFile;
|
return m_pluginFile;
|
||||||
|
|
|
@ -48,6 +48,7 @@ public:
|
||||||
PluginContainer(QString fileName,QString pluginName,PluginType type);
|
PluginContainer(QString fileName,QString pluginName,PluginType type);
|
||||||
~PluginContainer();
|
~PluginContainer();
|
||||||
SnorePlugin *load();
|
SnorePlugin *load();
|
||||||
|
void unload();
|
||||||
const QString &file();
|
const QString &file();
|
||||||
const QString &name();
|
const QString &name();
|
||||||
PluginContainer::PluginType type();
|
PluginContainer::PluginType type();
|
||||||
|
|
|
@ -86,9 +86,8 @@ void SnoreCore::loadPlugins ( PluginContainer::PluginTypes types )
|
||||||
}
|
}
|
||||||
case PluginContainer::SECONDARY_BACKEND:
|
case PluginContainer::SECONDARY_BACKEND:
|
||||||
{
|
{
|
||||||
SnoreSecondaryBackend *nb = qobject_cast<SnoreSecondaryBackend *> ( info->load() );
|
if(!info->load()->init( this )){
|
||||||
if(!nb->init( this )){
|
info->unload();
|
||||||
nb->deleteLater();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_secondaryNotificationBackends.append(info->name());
|
m_secondaryNotificationBackends.append(info->name());
|
||||||
|
@ -96,10 +95,9 @@ void SnoreCore::loadPlugins ( PluginContainer::PluginTypes types )
|
||||||
}
|
}
|
||||||
case PluginContainer::FRONTEND:
|
case PluginContainer::FRONTEND:
|
||||||
{
|
{
|
||||||
SnoreFrontend * nf = qobject_cast<SnoreFrontend*> (info->load());
|
|
||||||
qDebug() <<info->name()<<"is a Notification_Frontend";
|
qDebug() <<info->name()<<"is a Notification_Frontend";
|
||||||
if(!nf->init( this )){
|
if(!info->load()->init( this )){
|
||||||
nf->deleteLater();
|
info->unload();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_Frontends.append(info->name());
|
m_Frontends.append(info->name());
|
||||||
|
@ -109,7 +107,7 @@ void SnoreCore::loadPlugins ( PluginContainer::PluginTypes types )
|
||||||
{
|
{
|
||||||
qDebug() <<info->name()<<"is a SnorePlugin";
|
qDebug() <<info->name()<<"is a SnorePlugin";
|
||||||
if(!info->load()->init(this)){
|
if(!info->load()->init(this)){
|
||||||
info->load()->deleteLater();
|
info->unload();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_plugins.append(info->name());
|
m_plugins.append(info->name());
|
||||||
|
|
Loading…
Reference in New Issue