StelFileMgr.cpp   StelFileMgr.cpp 
skipping to change at line 86 skipping to change at line 86
// Then add the installation directory to the search path // Then add the installation directory to the search path
try try
{ {
fileLocations.append(getInstallationDir()); fileLocations.append(getInstallationDir());
} }
catch (std::runtime_error &e) catch (std::runtime_error &e)
{ {
qWarning() << "WARNING: could not locate installation direct ory"; qWarning() << "WARNING: could not locate installation direct ory";
} }
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) #ifdef Q_OS_WIN
// This solution work fine on all Windows
screenshotDir = QDesktopServices::storageLocation(QDesktopServices::
PicturesLocation);
#elif defined Q_OS_MAC
screenshotDir = getDesktopDir(); screenshotDir = getDesktopDir();
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPat h());
#else #else
screenshotDir = QDir::homePath(); screenshotDir = QDir::homePath();
#endif #endif
#ifdef Q_OS_MAC
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPat
h());
#endif
} }
QString StelFileMgr::findFile(const QString& path, const Flags& flags) QString StelFileMgr::findFile(const QString& path, const Flags& flags)
{ {
if (path.isEmpty()) if (path.isEmpty())
throw std::runtime_error("Empty file path"); throw std::runtime_error("Empty file path");
// explicitly specified relative paths // explicitly specified relative paths
if (path[0] == '.') if (path[0] == '.')
{ {
if (fileFlagsCheck(path, flags)) if (fileFlagsCheck(path, flags))
skipping to change at line 365 skipping to change at line 365
// doesn't exist and New flag wasn't requested // doesn't exist and New flag wasn't requested
return false ; return false ;
} }
return true; return true;
} }
QString StelFileMgr::getDesktopDir() QString StelFileMgr::getDesktopDir()
{ {
QString result; QString result;
#ifdef Q_OS_WIN
result = getWin32SpecialDirPath(CSIDL_DESKTOPDIRECTORY);
#else
// TODO: this is not going to work for machines which are non-Englis h... // TODO: this is not going to work for machines which are non-Englis h...
// For Linux and perhaps some BSDs, we can call the external program // For Linux and perhaps some BSDs, we can call the external program
// "xdg-user-dir DESKTOP" if it exists, but I'm not sure about OSX. // "xdg-user-dir DESKTOP" if it exists, but I'm not sure about OSX.
result = QFile::decodeName(getenv("HOME")); result = QFile::decodeName(getenv("HOME"));
result += "/Desktop"; result += "/Desktop";
#endif
if (!QFileInfo(result).isDir()) if (!QFileInfo(result).isDir())
{ {
throw std::runtime_error("Can't find Desktop directory"); throw std::runtime_error("Can't find Desktop directory");
} }
return result; return result;
} }
QString StelFileMgr::getUserDir() QString StelFileMgr::getUserDir()
{ {
return userDir; return userDir;
 End of changes. 5 change blocks. 
10 lines changed or deleted 7 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/