StelModuleMgr.cpp   StelModuleMgr.cpp 
skipping to change at line 89 skipping to change at line 89
*************************************************************************/ *************************************************************************/
void StelModuleMgr::unloadModule(const QString& moduleID, bool alsoDelete) void StelModuleMgr::unloadModule(const QString& moduleID, bool alsoDelete)
{ {
StelModule* m = getModule(moduleID); StelModule* m = getModule(moduleID);
if (!m) if (!m)
{ {
qWarning() << "Module" << moduleID << "is not loaded."; qWarning() << "Module" << moduleID << "is not loaded.";
return; return;
} }
modules.remove(moduleID); modules.remove(moduleID);
m->setParent(NULL); m->setParent(Q_NULLPTR);
callingListsToRegenerate = true; callingListsToRegenerate = true;
if (alsoDelete) if (alsoDelete)
{ {
m->deinit(); m->deinit();
delete m; delete m;
} }
} }
/************************************************************************* /*************************************************************************
Get the corresponding module or NULL if can't find it. Get the corresponding module or Q_NULLPTR if can't find it.
*************************************************************************/ *************************************************************************/
StelModule* StelModuleMgr::getModule(const QString& moduleID, bool noWarnin g) StelModule* StelModuleMgr::getModule(const QString& moduleID, bool noWarnin g)
{ {
StelModule* module = modules.value(moduleID, NULL); StelModule* module = modules.value(moduleID, Q_NULLPTR);
if (module == NULL) if (module == Q_NULLPTR)
{ {
if (noWarning==false) if (noWarning==false)
qWarning() << "Unable to find module called" << modu leID; qWarning() << "Unable to find module called" << modu leID;
} }
return module; return module;
} }
/************************************************************************* /*************************************************************************
Load an external plugin Load an external plugin
*************************************************************************/ *************************************************************************/
skipping to change at line 129 skipping to change at line 129
if (desc.info.id==moduleID) if (desc.info.id==moduleID)
{ {
Q_ASSERT(desc.pluginInterface); Q_ASSERT(desc.pluginInterface);
StelModule* sMod = desc.pluginInterface->getStelModu le(); StelModule* sMod = desc.pluginInterface->getStelModu le();
qDebug() << "Loaded plugin" << moduleID; qDebug() << "Loaded plugin" << moduleID;
pluginDescriptorList[moduleID].loaded=true; pluginDescriptorList[moduleID].loaded=true;
return sMod; return sMod;
} }
} }
qWarning() << "Unable to find plugin called" << moduleID; qWarning() << "Unable to find plugin called" << moduleID;
return NULL; return Q_NULLPTR;
}
QObjectList StelModuleMgr::loadExtensions(const QString &moduleID)
{
foreach (const PluginDescriptor& desc, getPluginsList())
{
if (desc.info.id==moduleID)
{
Q_ASSERT(desc.pluginInterface);
QObjectList exts = desc.pluginInterface->getExtensio
nList();
if(!exts.isEmpty())
{
extensions.append(exts);
emit extensionsAdded(exts);
qDebug() << "Loaded"<<exts.size()<<"extensio
ns for"<<moduleID;
}
return exts;
}
}
qWarning() << "Unable to find plugin called" << moduleID;
return QObjectList();
} }
struct StelModuleOrderComparator struct StelModuleOrderComparator
{ {
StelModuleOrderComparator(StelModule::StelModuleActionName aaction) : action(aaction) {;} StelModuleOrderComparator(StelModule::StelModuleActionName aaction) : action(aaction) {;}
bool operator()(StelModule* x, StelModule* y) {return x->getCallOrde r(action)<y->getCallOrder(action);} bool operator()(StelModule* x, StelModule* y) {return x->getCallOrde r(action)<y->getCallOrder(action);}
private: private:
StelModule::StelModuleActionName action; StelModule::StelModuleActionName action;
}; };
 End of changes. 4 change blocks. 
5 lines changed or deleted 29 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/