StelFileMgr.cpp   StelFileMgr.cpp 
skipping to change at line 33 skipping to change at line 33
#include <QCoreApplication> #include <QCoreApplication>
#include <QFileInfo> #include <QFileInfo>
#include <QDir> #include <QDir>
#include <QString> #include <QString>
#include <QDebug> #include <QDebug>
#include <QStandardPaths> #include <QStandardPaths>
#include <stdio.h> #include <stdio.h>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# include <windows.h> #include <windows.h>
# ifndef _SHOBJ_H #ifndef _SHOBJ_H
# include <shlobj.h> #include <shlobj.h>
# include <QLibrary> #include <QLibrary>
# endif #endif
#endif #endif
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
// Initialize static members. // Initialize static members.
QStringList StelFileMgr::fileLocations; QStringList StelFileMgr::fileLocations;
QString StelFileMgr::userDir; QString StelFileMgr::userDir;
QString StelFileMgr::screenshotDir; QString StelFileMgr::screenshotDir;
QString StelFileMgr::installDir; QString StelFileMgr::installDir;
skipping to change at line 88 skipping to change at line 88
// Determine install data directory location // Determine install data directory location
// If we are running from the build tree, we use the files from the current directory // If we are running from the build tree, we use the files from the current directory
if (QFileInfo(CHECK_FILE).exists()) if (QFileInfo(CHECK_FILE).exists())
{ {
installDir = "."; installDir = ".";
} }
else else
{ {
#ifdef Q_OS_MAC #if defined(Q_OS_MAC)
QString relativePath = "/../Resources"; QString relativePath = "/../Resources";
if (QCoreApplication::applicationDirPath().contains("src")) { if (QCoreApplication::applicationDirPath().contains("src")) {
relativePath = "/../.."; relativePath = "/../..";
} }
QFileInfo MacOSdir(QCoreApplication::applicationDirPath() + relativePath); QFileInfo MacOSdir(QCoreApplication::applicationDirPath() + relativePath);
// These two lines are used to see if the Qt bug still exist s. // These two lines are used to see if the Qt bug still exist s.
// The output from C: should simply be the parent of what is show for B: // The output from C: should simply be the parent of what is show for B:
qDebug() << "B: " << MacOSdir.absolutePath(); qDebug() << "B: " << MacOSdir.absolutePath();
qDebug() << "C: " << MacOSdir.dir().absolutePath(); qDebug() << "C: " << MacOSdir.dir().absolutePath();
QDir ResourcesDir(MacOSdir.absolutePath()); QDir ResourcesDir(MacOSdir.absolutePath());
if (!QCoreApplication::applicationDirPath().contains("src")) { if (!QCoreApplication::applicationDirPath().contains("src")) {
ResourcesDir.cd(QString("Resources")); ResourcesDir.cd(QString("Resources"));
} }
QFileInfo installLocation(ResourcesDir.absolutePath()); QFileInfo installLocation(ResourcesDir.absolutePath());
QFileInfo checkFile(installLocation.filePath() + QString("/" ) + QString(CHECK_FILE)); QFileInfo checkFile(installLocation.filePath() + QString("/" ) + QString(CHECK_FILE));
#else #elif defined(Q_OS_WIN)
QFileInfo installLocation(QCoreApplication::applicationDirPa
th());
QFileInfo checkFile(installLocation.filePath() + QDir::separ
ator() + QString(CHECK_FILE));
#else
// Linux, BSD, Solaris etc. // Linux, BSD, Solaris etc.
// We use the value from the config.h filesystem // We use the value from the config.h filesystem
QFileInfo installLocation(QFile::decodeName(INSTALL_DATADIR) ); QFileInfo installLocation(QFile::decodeName(INSTALL_DATADIR) );
QFileInfo checkFile(QFile::decodeName(INSTALL_DATADIR "/" CH ECK_FILE)); QFileInfo checkFile(QFile::decodeName(INSTALL_DATADIR "/" CH ECK_FILE));
#endif #endif
if (checkFile.exists()) if (checkFile.exists())
{ {
installDir = installLocation.filePath(); installDir = installLocation.filePath();
} }
else else
{ {
qWarning() << "WARNING StelFileMgr::StelFileMgr: cou ld not find install location:" << qWarning() << "WARNING StelFileMgr::StelFileMgr: cou ld not find install location:" <<
QDir::toNativeSeparators(installLocation.fil ePath()) << " (we checked for " << QDir::toNativeSeparators(installLocation.fil ePath()) << " (we checked for " <<
QDir::toNativeSeparators(checkFile.filePath( )) << ")."; QDir::toNativeSeparators(checkFile.filePath( )) << ").";
qFatal("Couldn't find install directory location."); qFatal("Couldn't find install directory location.");
 End of changes. 4 change blocks. 
8 lines changed or deleted 13 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/