StelApp.cpp   StelApp.cpp 
skipping to change at line 54 skipping to change at line 54
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelFontMgr.hpp" #include "StelFontMgr.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelSkyCultureMgr.hpp" #include "StelSkyCultureMgr.hpp"
#include "StelMovementMgr.hpp" #include "StelMovementMgr.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelScriptMgr.hpp" #include "StelScriptMgr.hpp"
#include "StelJsonParser.hpp" #include "StelJsonParser.hpp"
#include "StelSkyImageMgr.hpp" #include "StelSkyImageMgr.hpp"
#include "StelAudioMgr.hpp" #include "StelAudioMgr.hpp"
#include "StelMainWindow.hpp"
#include "StelStyle.hpp" #include "StelStyle.hpp"
#include <iostream> #include <iostream>
#include <QStringList> #include <QStringList>
#include <QString> #include <QString>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QRegExp> #include <QRegExp>
#include <QTextStream> #include <QTextStream>
#include <QMouseEvent> #include <QMouseEvent>
skipping to change at line 273 skipping to change at line 273
moduleMgr->unloadModule("StelSkyImageMgr", false); // We need to de lete it afterward moduleMgr->unloadModule("StelSkyImageMgr", false); // We need to de lete it afterward
moduleMgr->unloadModule("StelObjectMgr", false);// We need to delete it afterward moduleMgr->unloadModule("StelObjectMgr", false);// We need to delete it afterward
StelModuleMgr* tmp = moduleMgr; StelModuleMgr* tmp = moduleMgr;
moduleMgr = new StelModuleMgr(); // Create a secondary instance to a void crashes at other deinit moduleMgr = new StelModuleMgr(); // Create a secondary instance to a void crashes at other deinit
delete tmp; tmp=NULL; delete tmp; tmp=NULL;
delete loadingBar; loadingBar=NULL; delete loadingBar; loadingBar=NULL;
delete core; core=NULL; delete core; core=NULL;
delete skyCultureMgr; skyCultureMgr=NULL; delete skyCultureMgr; skyCultureMgr=NULL;
delete localeMgr; localeMgr=NULL; delete localeMgr; localeMgr=NULL;
delete fontManager; fontManager=NULL; delete fontManager; fontManager=NULL;
delete skyImageMgr; skyImageMgr=NULL; // Delete the module by hand a fterward
delete audioMgr; audioMgr=NULL; delete audioMgr; audioMgr=NULL;
delete stelObjectMgr; stelObjectMgr=NULL; // Delete the module by ha nd afterward delete stelObjectMgr; stelObjectMgr=NULL; // Delete the module by ha nd afterward
delete stelFileMgr; stelFileMgr=NULL; delete stelFileMgr; stelFileMgr=NULL;
delete textureMgr; textureMgr=NULL; delete textureMgr; textureMgr=NULL;
delete planetLocationMgr; planetLocationMgr=NULL; delete planetLocationMgr; planetLocationMgr=NULL;
delete moduleMgr; moduleMgr=NULL; // Delete the secondary instance delete moduleMgr; moduleMgr=NULL; // Delete the secondary instance
delete argList; argList=NULL; delete argList; argList=NULL;
delete currentStelStyle; delete currentStelStyle;
skipping to change at line 307 skipping to change at line 306
*************************************************************************/ *************************************************************************/
QString StelApp::getApplicationName() QString StelApp::getApplicationName()
{ {
#ifdef SVN_REVISION #ifdef SVN_REVISION
return QString("Stellarium")+" "+PACKAGE_VERSION+" (SVN r"+SVN_REVIS ION+")"; return QString("Stellarium")+" "+PACKAGE_VERSION+" (SVN r"+SVN_REVIS ION+")";
#else #else
return QString("Stellarium")+" "+PACKAGE_VERSION; return QString("Stellarium")+" "+PACKAGE_VERSION;
#endif #endif
} }
/*************************************************************************
Return the version of stellarium, i.e. "0.9.0"
*************************************************************************/
QString StelApp::getApplicationVersion()
{
#ifdef SVN_REVISION
return QString(PACKAGE_VERSION)+" (SVN r"+SVN_REVISION+")";
#else
return QString(PACKAGE_VERSION);
#endif
}
void StelApp::debugLogHandler(QtMsgType type, const char* msg) void StelApp::debugLogHandler(QtMsgType type, const char* msg)
{ {
fprintf(stderr, "%s\n", msg); fprintf(stderr, "%s\n", msg);
StelApp::writeLog(QString(msg)); StelApp::writeLog(QString(msg));
} }
void StelApp::writeLog(QString msg) void StelApp::writeLog(QString msg)
{ {
msg += "\n"; msg += "\n";
logFile.write(qPrintable(msg), msg.size()); logFile.write(qPrintable(msg), msg.size());
log += msg; log += msg;
} }
void StelApp::init() void StelApp::init()
{ {
networkAccessManager = new QNetworkAccessManager(this); networkAccessManager = new QNetworkAccessManager(this);
// #if QT_VERSION >= 0x040500 #if QT_VERSION >= 0x040500
// // Activate http cache if Qt version >= 4.5 // Activate http cache if Qt version >= 4.5
// QNetworkDiskCache* cache = new QNetworkDiskCache(networkAccessManage QNetworkDiskCache* cache = new QNetworkDiskCache(networkAccessManage
r); r);
// QString cachePath = QDesktopServices::storageLocation(QDesktopServic QString cachePath = QDesktopServices::storageLocation(QDesktopServic
es::CacheLocation); es::CacheLocation);
// if (cachePath.isEmpty()) if (cachePath.isEmpty())
// { {
// cachePath = StelApp::getInstance().getFileMgr().getUserDir() cachePath = StelApp::getInstance().getFileMgr().getUserDir()
+"/cache"; +"/cache";
// } }
// qDebug() << "Cache directory is: " << cachePath; qDebug() << "Cache directory is: " << cachePath;
// cache->setCacheDirectory(cachePath); cache->setCacheDirectory(cachePath);
// networkAccessManager->setCache(cache); networkAccessManager->setCache(cache);
// #endif #endif
connect(networkAccessManager, SIGNAL(finished(QNetworkReply*)), this , SLOT(reportFileDownloadFinished(QNetworkReply*))); connect(networkAccessManager, SIGNAL(finished(QNetworkReply*)), this , SLOT(reportFileDownloadFinished(QNetworkReply*)));
// Stel Object Data Base manager
stelObjectMgr = new StelObjectMgr();
stelObjectMgr->init();
getModuleMgr().registerModule(stelObjectMgr);
core = new StelCore(); core = new StelCore();
if (saveProjW!=-1 && saveProjH!=-1) if (saveProjW!=-1 && saveProjH!=-1)
core->windowHasBeenResized(saveProjW, saveProjH); core->windowHasBeenResized(saveProjW, saveProjH);
textureMgr = new StelTextureMgr(); textureMgr = new StelTextureMgr();
localeMgr = new StelLocaleMgr(); localeMgr = new StelLocaleMgr();
fontManager = new StelFontMgr(); fontManager = new StelFontMgr();
skyCultureMgr = new StelSkyCultureMgr(); skyCultureMgr = new StelSkyCultureMgr();
planetLocationMgr = new StelLocationMgr(); planetLocationMgr = new StelLocationMgr();
// Initialize AFTER creation of openGL context // Initialize AFTER creation of openGL context
textureMgr->init(); textureMgr->init();
#ifdef SVN_REVISION #ifdef SVN_REVISION
loadingBar = new StelLoadingBar(12., "logo24bits.png", QString("SVN r%1").arg(SVN_REVISION), 25, 320, 101); loadingBar = new StelLoadingBar(12., "logo24bits.png", QString("SVN r%1").arg(SVN_REVISION), 25, 320, 101);
#else #else
loadingBar = new StelLoadingBar(12., "logo24bits.png", PACKAGE_VERSI ON, 45, 320, 121); loadingBar = new StelLoadingBar(12., "logo24bits.png", PACKAGE_VERSI ON, 45, 320, 121);
#endif // SVN_RELEASE #endif // SVN_RELEASE
downloadMgr = new StelDownloadMgr(); downloadMgr = new StelDownloadMgr();
// Stel Object Data Base manager
stelObjectMgr = new StelObjectMgr();
stelObjectMgr->init();
getModuleMgr().registerModule(stelObjectMgr);
localeMgr->init(); localeMgr->init();
skyCultureMgr->init(); skyCultureMgr->init();
// Init the solar system first // Init the solar system first
SolarSystem* ssystem = new SolarSystem(); SolarSystem* ssystem = new SolarSystem();
ssystem->init(); ssystem->init();
getModuleMgr().registerModule(ssystem); getModuleMgr().registerModule(ssystem);
// Load hipparcos stars & names // Load hipparcos stars & names
StarMgr* hip_stars = new StarMgr(); StarMgr* hip_stars = new StarMgr();
skipping to change at line 1159 skipping to change at line 1171
if (flagNightVision!=b) if (flagNightVision!=b)
{ {
flagNightVision=b; flagNightVision=b;
setColorScheme(b ? "night_color" : "color"); setColorScheme(b ? "night_color" : "color");
} }
} }
// Update translations and font for sky everywhere in the program // Update translations and font for sky everywhere in the program
void StelApp::updateI18n() void StelApp::updateI18n()
{ {
StelMainWindow::getInstance().initTitleI18n();
// Send the event to every StelModule // Send the event to every StelModule
foreach (StelModule* iter, moduleMgr->getAllModules()) foreach (StelModule* iter, moduleMgr->getAllModules())
{ {
iter->updateI18n(); iter->updateI18n();
} }
} }
// Update and reload sky culture informations everywhere in the program // Update and reload sky culture informations everywhere in the program
void StelApp::updateSkyCulture() void StelApp::updateSkyCulture()
{ {
QString skyCultureDir = getSkyCultureMgr().getCurrentSkyCultureID();
// Send the event to every StelModule // Send the event to every StelModule
foreach (StelModule* iter, moduleMgr->getAllModules()) foreach (StelModule* iter, moduleMgr->getAllModules())
{ {
iter->updateSkyCulture(); iter->updateSkyCulture(skyCultureDir);
} }
} }
bool StelApp::argsGetOption(QStringList* args, QString shortOpt, QString lo ngOpt) bool StelApp::argsGetOption(QStringList* args, QString shortOpt, QString lo ngOpt)
{ {
bool result=false; bool result=false;
// Don't see anything after a -- as an option // Don't see anything after a -- as an option
int lastOptIdx = args->indexOf("--"); int lastOptIdx = args->indexOf("--");
if (lastOptIdx == -1) if (lastOptIdx == -1)
 End of changes. 9 change blocks. 
23 lines changed or deleted 37 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/