StelFileMgr.cpp   StelFileMgr.cpp 
skipping to change at line 127 skipping to change at line 127
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.");
} }
} }
// Then add the installation directory to the search path // Then add the installation directory to the search path
fileLocations.append(installDir); fileLocations.append(installDir);
QString screenshotDirSuffix = "/Stellarium"; // Wasn't set path to screenshots directory via --screenshot-dir?
if (!QStandardPaths::standardLocations(QStandardPaths::PicturesLocat if (screenshotDir.isEmpty())
ion).isEmpty()) {
screenshotDir = QStandardPaths::standardLocations(QStandardP QString screenshotDirSuffix = "/Stellarium";
aths::PicturesLocation)[0].append(screenshotDirSuffix); if (!QStandardPaths::standardLocations(QStandardPaths::Pictu
else resLocation).isEmpty())
screenshotDir = userDir.append(screenshotDirSuffix); screenshotDir = QStandardPaths::standardLocations(QS
tandardPaths::PicturesLocation)[0].append(screenshotDirSuffix);
else
screenshotDir = userDir.append(screenshotDirSuffix);
}
makeSureDirExistsAndIsWritable(screenshotDir); makeSureDirExistsAndIsWritable(screenshotDir);
} }
QString StelFileMgr::findFile(const QString& path, Flags flags) QString StelFileMgr::findFile(const QString& path, Flags flags)
{ {
if (path.isEmpty()) if (path.isEmpty())
{ {
qWarning() << "Empty file path"; qWarning() << "Empty file path";
return ""; return "";
} }
skipping to change at line 397 skipping to change at line 400
return installDir; return installDir;
} }
QString StelFileMgr::getScreenshotDir() QString StelFileMgr::getScreenshotDir()
{ {
return screenshotDir; return screenshotDir;
} }
void StelFileMgr::setScreenshotDir(const QString& newDir) void StelFileMgr::setScreenshotDir(const QString& newDir)
{ {
makeSureDirExistsAndIsWritable(newDir);
QFileInfo userDirFI(newDir); QFileInfo userDirFI(newDir);
if (!userDirFI.exists() || !userDirFI.isDir())
{
qWarning() << "WARNING StelFileMgr::setScreenshotDir dir doe
s not exist: " << QDir::toNativeSeparators(userDirFI.filePath());
throw std::runtime_error("NOT_VALID");
}
else if (!userDirFI.isWritable())
{
qWarning() << "WARNING StelFileMgr::setScreenshotDir dir is
not writable: " << QDir::toNativeSeparators(userDirFI.filePath());
throw std::runtime_error("NOT_VALID");
}
screenshotDir = userDirFI.filePath(); screenshotDir = userDirFI.filePath();
} }
QString StelFileMgr::getLocaleDir() QString StelFileMgr::getLocaleDir()
{ {
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
QFileInfo localePath = QFileInfo(getInstallationDir() + "/translatio ns"); QFileInfo localePath = QFileInfo(getInstallationDir() + "/translatio ns");
if (localePath.exists()) if (localePath.exists())
{ {
return localePath.filePath(); return localePath.filePath();
 End of changes. 3 change blocks. 
20 lines changed or deleted 12 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/