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";
} }
#ifdef Q_OS_WIN
// This solution work fine on all Windows
screenshotDir = QDesktopServices::storageLocation(QDesktopServices:: PicturesLocation); screenshotDir = QDesktopServices::storageLocation(QDesktopServices:: PicturesLocation);
#elif defined Q_OS_MAC
screenshotDir = getDesktopDir();
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPat
h());
#else
screenshotDir = QDir::homePath();
#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 364 skipping to change at line 356
{ {
// 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 = QDesktopServices::storageLocation(QDesktopServices:
// TODO: this is not going to work for machines which are non-Englis :DesktopLocation);
h...
// 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.
result = QFile::decodeName(getenv("HOME"));
result += "/Desktop";
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()
{ {
 End of changes. 3 change blocks. 
16 lines changed or deleted 2 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/