~registry/stellarium/socis2015-de430

« back to all changes in this revision

Viewing changes to src/main.cpp

  • Committer: georg-zotti
  • Date: 2015-12-14 13:02:24 UTC
  • mfrom: (7721.1.367 trunk)
  • Revision ID: georg.zotti@univie.ac.at-20151214130224-g5sqnc31ghcmw0ux
merge-in trunk r8088

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
        cacheMgr->clear(); // Removes all items from the cache.
111
111
}
112
112
 
113
 
void registerPluginsDir(QDir& appDir)
114
 
{
115
 
        QStringList pathes;
116
 
        // Windows
117
 
        pathes << appDir.absolutePath();
118
 
        pathes << appDir.absoluteFilePath("platforms");
119
 
        // OS X
120
 
        appDir.cdUp();  
121
 
        pathes << appDir.absoluteFilePath("plugins");
122
 
        // All systems
123
 
        pathes << QCoreApplication::libraryPaths();
124
 
        QCoreApplication::setLibraryPaths(pathes);
125
 
}
126
 
 
127
113
// Main stellarium procedure
128
114
int main(int argc, char **argv)
129
115
{
145
131
        QCoreApplication::setOrganizationDomain("stellarium.org");
146
132
        QCoreApplication::setOrganizationName("stellarium");
147
133
 
148
 
        // LP:1335611: Avoid troubles with search of the paths of the plugins (deployments troubles) --AW
 
134
        #if defined(Q_OS_MAC)
149
135
        QFileInfo appInfo(QString::fromUtf8(argv[0]));
150
136
        QDir appDir(appInfo.absolutePath());
151
 
        registerPluginsDir(appDir);
 
137
        appDir.cdUp();
 
138
        QCoreApplication::addLibraryPath(appDir.absoluteFilePath("plugins"));
 
139
        #elif defined(Q_OS_WIN)
 
140
        QFileInfo appInfo(QString::fromUtf8(argv[0]));
 
141
        QCoreApplication::addLibraryPath(appInfo.absolutePath());
 
142
        #endif  
152
143
 
153
144
        QGuiApplication::setDesktopSettingsAware(false);
154
145
 
185
176
        // output, such as --help and --version
186
177
        CLIProcessor::parseCLIArgsPreConfig(argList);
187
178
 
 
179
        #ifdef Q_OS_WIN
 
180
        #if QT_VERSION >= 0x050300
 
181
        if (qApp->property("onetime_angle_mode").isValid())
 
182
        {
 
183
                app.setAttribute(Qt::AA_UseOpenGLES, true);
 
184
        }
 
185
        #endif
 
186
        #if QT_VERSION >= 0x050400
 
187
        if (qApp->property("onetime_mesa_mode").isValid())
 
188
        {
 
189
                app.setAttribute(Qt::AA_UseSoftwareOpenGL, true);
 
190
        }
 
191
        #endif
 
192
        #endif
 
193
 
188
194
        // Start logging.
189
195
        StelLogger::init(StelFileMgr::getUserDir()+"/log.txt");
190
196
        StelLogger::writeLog(argStr);
192
198
        // OK we start the full program.
193
199
        // Print the console splash and get on with loading the program
194
200
        QString versionLine = QString("This is %1 - http://www.stellarium.org").arg(StelUtils::getApplicationName());
195
 
        QString copyrightLine = QString("Copyright (C) 2000-2015 Fabien Chereau et al.");
 
201
        QString copyrightLine = QString("Copyright (C) %1 Fabien Chereau et al.").arg(COPYRIGHT_YEARS);
196
202
        int maxLength = qMax(versionLine.size(), copyrightLine.size());
197
203
        qDebug() << qPrintable(QString(" %1").arg(QString().fill('-', maxLength+2)));
198
204
        qDebug() << qPrintable(QString("[ %1 ]").arg(versionLine.leftJustified(maxLength, ' ')));