CLIProcessor.cpp   CLIProcessor.cpp 
skipping to change at line 29 skipping to change at line 29
#include "CLIProcessor.hpp" #include "CLIProcessor.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include <QSettings> #include <QSettings>
#include <QDateTime> #include <QDateTime>
#include <QDebug> #include <QDebug>
#include <iostream> #include <iostream>
#include <QApplication> #include <QGuiApplication>
#include <QDir> #include <QDir>
#include <stdio.h>
void CLIProcessor::parseCLIArgsPreConfig(const QStringList& argList) void CLIProcessor::parseCLIArgsPreConfig(const QStringList& argList)
{ {
if (argsGetOption(argList, "-v", "--version")) if (argsGetOption(argList, "-v", "--version"))
{ {
std::cout << qPrintable(StelUtils::getApplicationName()) << std::endl; std::cout << qPrintable(StelUtils::getApplicationName()) << std::endl;
exit(0); exit(0);
} }
if (argsGetOption(argList, "-h", "--help")) if (argsGetOption(argList, "-h", "--help"))
{ {
skipping to change at line 54 skipping to change at line 56
binName.remove(QRegExp("^.*[/\\\\]")); binName.remove(QRegExp("^.*[/\\\\]"));
std::cout << "Usage:\n" std::cout << "Usage:\n"
<< " " << " "
<< qPrintable(binName) << " [options]\n\n" << qPrintable(binName) << " [options]\n\n"
<< "Options:\n" << "Options:\n"
<< "--version (or -v) : Print program name a nd version and exit.\n" << "--version (or -v) : Print program name a nd version and exit.\n"
<< "--help (or -h) : This cruft.\n" << "--help (or -h) : This cruft.\n"
<< "--config-file (or -c) : Use an alternative n ame for the config file\n" << "--config-file (or -c) : Use an alternative n ame for the config file\n"
<< "--user-dir (or -u) : Use an alternative u ser data directory\n" << "--user-dir (or -u) : Use an alternative u ser data directory\n"
<< "--safe-mode (or -s) : Disable shaders and //<< "--safe-mode (or -s) : Disable GL shaders
use older GL renderer\n" and use older GL engine\n"
<< " Try this is you have //<< " Try this is you ha
graphics problems\n" ve graphics problems\n"
<< "--full-screen (or -f) : With argument \"yes\ " or \"no\" over-rides\n" << "--full-screen (or -f) : With argument \"yes\ " or \"no\" over-rides\n"
<< " the full screen sett ing in the config file\n" << " the full screen sett ing in the config file\n"
<< "--screenshot-dir : Specify directory to save screenshots\n" << "--screenshot-dir : Specify directory to save screenshots\n"
<< "--startup-script : Specify name of star tup script\n" << "--startup-script : Specify name of star tup script\n"
<< "--home-planet : Specify observer pla net (English name)\n" << "--home-planet : Specify observer pla net (English name)\n"
<< "--altitude : Specify observer alt itude in meters\n" << "--altitude : Specify observer alt itude in meters\n"
<< "--longitude : Specify longitude, e .g. +53d58\\'16.65\\\"\n" << "--longitude : Specify longitude, e .g. +53d58\\'16.65\\\"\n"
<< "--latitude : Specify latitude, e. g. -1d4\\'27.48\\\"\n" << "--latitude : Specify latitude, e. g. -1d4\\'27.48\\\"\n"
<< "--list-landscapes : Print a list of valu e landscape IDs\n" << "--list-landscapes : Print a list of valu e landscape IDs\n"
<< "--landscape : Start using landscap e whose ID (dir name)\n" << "--landscape : Start using landscap e whose ID (dir name)\n"
skipping to change at line 77 skipping to change at line 79
<< "--sky-date : Specify sky date in format yyyymmdd\n" << "--sky-date : Specify sky date in format yyyymmdd\n"
<< "--sky-time : Specify sky time in format hh:mm:ss\n" << "--sky-time : Specify sky time in format hh:mm:ss\n"
<< "--fov : Specify the field of view (degrees)\n" << "--fov : Specify the field of view (degrees)\n"
<< "--projection-type : Specify projection t ype, e.g. stereographic\n" << "--projection-type : Specify projection t ype, e.g. stereographic\n"
<< "--restore-defaults : Delete existing conf ig.ini and use defaults\n" << "--restore-defaults : Delete existing conf ig.ini and use defaults\n"
<< "--multires-image : With filename / URL argument, specify a\n" << "--multires-image : With filename / URL argument, specify a\n"
<< " multi-resolution ima ge to load\n"; << " multi-resolution ima ge to load\n";
exit(0); exit(0);
} }
/*
if (argsGetOption(argList, "-s", "--safe-mode")) if (argsGetOption(argList, "-s", "--safe-mode"))
{ {
qApp->setProperty("onetime_safe_mode", true); qApp->setProperty("onetime_safe_mode", true);
} }
*/
if (argsGetOption(argList, "", "--list-landscapes")) if (argsGetOption(argList, "", "--list-landscapes"))
{ {
const QSet<QString>& landscapeIds = StelFileMgr::listContent s("landscapes", StelFileMgr::Directory); const QSet<QString>& landscapeIds = StelFileMgr::listContent s("landscapes", StelFileMgr::Directory);
foreach (const QString& i, landscapeIds) foreach (const QString& i, landscapeIds)
{ {
try // finding the file will throw an exception if it is
{ not found
// finding the file will throw an exception // in that case we won't output the landscape ID as
if it is not found it cannot work
// in that case we won't output the landscap if (!StelFileMgr::findFile("landscapes/" + i + "/lan
e ID as it cannot work dscape.ini").isEmpty())
StelFileMgr::findFile("landscapes/" + i + "/
landscape.ini");
std::cout << qPrintable(i) << std::endl; std::cout << qPrintable(i) << std::endl;
}
catch (std::runtime_error& e){}
} }
exit(0); exit(0);
} }
try try
{ {
QString newUserDir; QString newUserDir;
newUserDir = argsGetOptionWithArg(argList, "-u", "--user-dir ", "").toString(); newUserDir = argsGetOptionWithArg(argList, "-u", "--user-dir ", "").toString();
if (newUserDir!="" && !newUserDir.isEmpty()) if (newUserDir!="" && !newUserDir.isEmpty())
StelFileMgr::setUserDir(newUserDir); StelFileMgr::setUserDir(newUserDir);
 End of changes. 7 change blocks. 
15 lines changed or deleted 15 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/