main.cpp   main.cpp 
skipping to change at line 46 skipping to change at line 46
#include <QMessageBox> #include <QMessageBox>
#include <QStyleFactory> #include <QStyleFactory>
#else #else
#include <QGuiApplication> #include <QGuiApplication>
#endif #endif
#include <QCoreApplication> #include <QCoreApplication>
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QFontDatabase> #include <QFontDatabase>
#include <QGLFormat>
#include <QGuiApplication> #include <QGuiApplication>
#include <QSettings> #include <QSettings>
#include <QSplashScreen> #include <QSplashScreen>
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QTextStream> #include <QTextStream>
#include <QTranslator> #include <QTranslator>
#include <QNetworkDiskCache> #include <QNetworkDiskCache>
#include <clocale> #include <clocale>
skipping to change at line 113 skipping to change at line 112
} }
//! Removes all items from the cache. //! Removes all items from the cache.
void clearCache() void clearCache()
{ {
QNetworkDiskCache* cacheMgr = new QNetworkDiskCache(); QNetworkDiskCache* cacheMgr = new QNetworkDiskCache();
cacheMgr->setCacheDirectory(StelFileMgr::getCacheDir()); cacheMgr->setCacheDirectory(StelFileMgr::getCacheDir());
cacheMgr->clear(); // Removes all items from the cache. cacheMgr->clear(); // Removes all items from the cache.
} }
void registerPluginsDir(QDir& appDir)
{
QStringList pathes;
// Windows
pathes << appDir.absolutePath();
pathes << appDir.absoluteFilePath("platforms");
// OS X
appDir.cdUp();
pathes << appDir.absoluteFilePath("plugins");
// All systems
pathes << QCoreApplication::libraryPaths();
QCoreApplication::setLibraryPaths(pathes);
}
// Main stellarium procedure // Main stellarium procedure
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
// Fix for the speeding system clock bug on systems that use ACPI // Fix for the speeding system clock bug on systems that use ACPI
// See http://support.microsoft.com/kb/821893 // See http://support.microsoft.com/kb/821893
UINT timerGrain = 1; UINT timerGrain = 1;
if (timeBeginPeriod(timerGrain) == TIMERR_NOCANDO) if (timeBeginPeriod(timerGrain) == TIMERR_NOCANDO)
{ {
// If this is too fine a grain, try the lowest value used by a timer // If this is too fine a grain, try the lowest value used by a timer
skipping to change at line 147 skipping to change at line 160
argv = newArgv; argv = newArgv;
#endif #endif
QCoreApplication::setApplicationName("stellarium"); QCoreApplication::setApplicationName("stellarium");
QCoreApplication::setApplicationVersion(StelUtils::getApplicationVer sion()); QCoreApplication::setApplicationVersion(StelUtils::getApplicationVer sion());
QCoreApplication::setOrganizationDomain("stellarium.org"); QCoreApplication::setOrganizationDomain("stellarium.org");
QCoreApplication::setOrganizationName("stellarium"); QCoreApplication::setOrganizationName("stellarium");
// LP:1335611: Avoid troubles with search of the paths of the plugin s (deployments troubles) --AW // LP:1335611: Avoid troubles with search of the paths of the plugin s (deployments troubles) --AW
#if QT_VERSION>=QT_VERSION_CHECK(5, 3, 1) QFileInfo appInfo(QString::fromUtf8(argv[0]));
QCoreApplication::addLibraryPath("."); QDir appDir(appInfo.absolutePath());
#endif registerPluginsDir(appDir);
QGuiApplication::setDesktopSettingsAware(false); QGuiApplication::setDesktopSettingsAware(false);
#ifndef USE_QUICKVIEW #ifndef USE_QUICKVIEW
QApplication::setStyle(QStyleFactory::create("Fusion")); QApplication::setStyle(QStyleFactory::create("Fusion"));
// The QApplication MUST be created before the StelFileMgr is initia lized. // The QApplication MUST be created before the StelFileMgr is initia lized.
QApplication app(argc, argv); QApplication app(argc, argv);
#else #else
QGuiApplication::setDesktopSettingsAware(false); QGuiApplication::setDesktopSettingsAware(false);
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
skipping to change at line 345 skipping to change at line 358
QGuiApplication::setFont(tmpFont); QGuiApplication::setFont(tmpFont);
// Initialize translator feature // Initialize translator feature
StelTranslator::init(StelFileMgr::getInstallationDir() + "/data/iso6 39-1.utf8"); StelTranslator::init(StelFileMgr::getInstallationDir() + "/data/iso6 39-1.utf8");
// Use our custom translator for Qt translations as well // Use our custom translator for Qt translations as well
CustomQTranslator trans; CustomQTranslator trans;
app.installTranslator(&trans); app.installTranslator(&trans);
StelMainView mainWin; StelMainView mainWin;
mainWin.init(confSettings); // May exit(0) when OpenGL subsystem ins
ufficient
splash.finish(&mainWin);
app.exec();
mainWin.deinit();
delete confSettings;
StelLogger::deinit();
#ifdef Q_OS_WIN
if(timerGrain)
timeEndPeriod(timerGrain);
#endif //Q_OS_WIN
#ifdef Q_OS_MAC
delete(newArgv);
delete(option);
delete(value);
#endif
bool appCanRun = true; return 0;
// some basic diagnostics
if (!QGLFormat::hasOpenGL()){
qWarning() << "Oops... This system does not support OpenGL."
;
QMessageBox::warning(0, "Stellarium", q_("This system does n
ot support OpenGL."));
appCanRun = false;
}
if (!(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_
1) && !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0)
) // Check supported version of OpenGL
{
// OK, minimal required version of OpenGL is 2.1 and OpenGL
Shading Language is 1.20 (or OpenGL ES is 2.0 and GLSL ES is 2.0).
// Recommended OpenGL 3.0 and OpenGL Shading Language 1.30 a
nd above.
// If platform does not support this version then say to use
r about troubles and quit from application.
#ifdef Q_OS_WIN
qWarning() << "Oops... Insufficient OpenGL version. Please u
pdate drivers, graphics hardware, or use MESA (or ANGLE) version.";
QMessageBox::warning(0, "Stellarium", q_("Insufficient OpenG
L version. Please update drivers, graphics hardware, or use MESA (or ANGLE)
version."));
#else
qWarning() << "Oops... Insufficient OpenGL version. Please u
pdate drivers, or graphics hardware.";
QMessageBox::warning(0, "Stellarium", q_("Insufficient OpenG
L version. Please update drivers, or graphics hardware."));
#endif
appCanRun = false;
}
if (appCanRun)
{
mainWin.init(confSettings);
splash.finish(&mainWin);
app.exec();
mainWin.deinit();
delete confSettings;
StelLogger::deinit();
#ifdef Q_OS_WIN
if(timerGrain)
timeEndPeriod(timerGrain);
#endif //Q_OS_WIN
#ifdef Q_OS_MAC
delete(newArgv);
delete(option);
delete(value);
#endif
return 0;
}
else
{
app.quit();
}
} }
 End of changes. 5 change blocks. 
65 lines changed or deleted 36 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/