StelModuleMgr.cpp   StelModuleMgr.cpp 
skipping to change at line 20 skipping to change at line 20
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#include <config.h>
#include <QDebug> #include <QDebug>
#include <QPluginLoader> #include <QPluginLoader>
#include <QSettings> #include <QSettings>
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelModule.hpp" #include "StelModule.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelPluginInterface.hpp" #include "StelPluginInterface.hpp"
#include "StelIniParser.hpp" #include "StelIniParser.hpp"
skipping to change at line 90 skipping to change at line 88
{ {
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(NULL);
callingListsToRegenerate = true; callingListsToRegenerate = true;
if (alsoDelete) if (alsoDelete)
{ {
m->deinit(); m->deinit();
m->deleteLater(); delete m;
} }
} }
/************************************************************************* /*************************************************************************
Get the corresponding module or NULL if can't find it. Get the corresponding module or NULL if can't find it.
*************************************************************************/ *************************************************************************/
StelModule* StelModuleMgr::getModule(const QString& moduleID, bool noWarnin g) StelModule* StelModuleMgr::getModule(const QString& moduleID, bool noWarnin g)
{ {
QMap<QString, StelModule*>::const_iterator iter = modules.find(modul QMap<QString, StelModule*>::ConstIterator iter = modules.find(module
eID); ID);
if (iter==modules.end()) if (iter==modules.constEnd())
{ {
if (noWarning==false) if (noWarning==false)
qWarning() << "Warning can't find module called " << moduleID << "."; qWarning() << "Warning can't find module called " << moduleID << ".";
return NULL; return NULL;
} }
return iter.value(); return iter.value();
} }
/************************************************************************* /*************************************************************************
Load an external plugin Load an external plugin
skipping to change at line 149 skipping to change at line 147
{ {
QListIterator<PluginDescriptor> i(getPluginsList()); QListIterator<PluginDescriptor> i(getPluginsList());
i.toBack(); i.toBack();
while (i.hasPrevious()) while (i.hasPrevious())
{ {
const PluginDescriptor& d = i.previous(); const PluginDescriptor& d = i.previous();
if (d.loaded==false) if (d.loaded==false)
continue; continue;
unloadModule(d.info.id, true); unloadModule(d.info.id, true);
qDebug() << "Unloaded plugin " << d.info.id << "."; qDebug() << "Unloaded plugin " << d.info.id << ".";
} }
// Call update now to make sure that all references to the now delet
ed plugins modules
// are removed (fix crashes at application shutdown).
update();
} }
void StelModuleMgr::setPluginLoadAtStartup(const QString& key, bool b) void StelModuleMgr::setPluginLoadAtStartup(const QString& key, bool b)
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
conf->setValue("plugins_load_at_startup/"+key, b); conf->setValue("plugins_load_at_startup/"+key, b);
if (pluginDescriptorList.contains(key)) if (pluginDescriptorList.contains(key))
{ {
pluginDescriptorList[key].loadAtStartup=b; pluginDescriptorList[key].loadAtStartup=b;
} }
 End of changes. 5 change blocks. 
6 lines changed or deleted 9 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/