StratoscriptPreprocessor.cpp   StratoscriptPreprocessor.cpp 
skipping to change at line 34 skipping to change at line 34
#include <cmath> #include <cmath>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QMap> #include <QMap>
#include <QRegExp> #include <QRegExp>
#include <QString> #include <QString>
#include <QVariant> #include <QVariant>
#include <QDir>
bool StelScriptMgr::preprocessStratoScript(QFile& input, QString& output, c onst QString& scriptDir) bool StelScriptMgr::preprocessStratoScript(QFile& input, QString& output, c onst QString& scriptDir)
{ {
int n=0; int n=0;
qDebug() << "Translating stratoscript:"; qDebug() << "Translating stratoscript:";
while (!input.atEnd()) while (!input.atEnd())
{ {
QString line = QString::fromUtf8(input.readLine()); QString line = QString::fromUtf8(input.readLine());
line.replace(QRegExp("#.*$"), ""); line.replace(QRegExp("#.*$"), "");
QStringList args = line.split(QRegExp("\\s+")); QStringList args = line.split(QRegExp("\\s+"));
skipping to change at line 65 skipping to change at line 66
if (QFileInfo(fileName).isAbsolute()) if (QFileInfo(fileName).isAbsolute())
path = fileName; path = fileName;
else else
{ {
try try
{ {
path = StelFileMgr::findFile (scriptDir + "/" + fileName); path = StelFileMgr::findFile (scriptDir + "/" + fileName);
} }
catch(std::runtime_error& e) catch(std::runtime_error& e)
{ {
qWarning() << "WARNING: scri pt include:" << fileName << e.what(); qWarning() << "WARNING: scri pt include:" << QDir::toNativeSeparators(fileName) << e.what();
return false; return false;
} }
} }
QFile fic(path); QFile fic(path);
bool ok = fic.open(QIODevice::ReadOnly); bool ok = fic.open(QIODevice::ReadOnly);
if (ok) if (ok)
{ {
qDebug() << "script include: " << pa th; qDebug() << "script include: " << QD ir::toNativeSeparators(path);
preprocessScript(fic, output, script Dir); preprocessScript(fic, output, script Dir);
} }
else else
{ {
qWarning() << "WARNING: could not op en script include file for reading:" << path; qWarning() << "WARNING: could not op en script include file for reading:" << QDir::toNativeSeparators(path);
return false; return false;
} }
} }
else else
line = "// untranslated stratoscript (script ): " + line; line = "// untranslated stratoscript (script ): " + line;
} }
else if (args.at(0) == "landscape") else if (args.at(0) == "landscape")
{ {
if (args.at(1) == "load") if (args.at(1) == "load")
line = QString("LandscapeMgr.setCurrentLands capeID(\"%1\");").arg(args.at(2)); line = QString("LandscapeMgr.setCurrentLands capeID(\"%1\");").arg(args.at(2));
 End of changes. 4 change blocks. 
3 lines changed or deleted 4 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/