StelFileMgr.cpp   StelFileMgr.cpp 
skipping to change at line 62 skipping to change at line 62
userDir = winApiPath + "\\Stellarium"; userDir = winApiPath + "\\Stellarium";
} }
#elif defined(Q_OS_MAC) #elif defined(Q_OS_MAC)
userDir = QDir::homePath() + "/Library/Application Support/Stellariu m"; userDir = QDir::homePath() + "/Library/Application Support/Stellariu m";
#else #else
userDir = QDir::homePath() + "/.stellarium"; userDir = QDir::homePath() + "/.stellarium";
#endif #endif
if (!QFile(userDir).exists()) if (!QFile(userDir).exists())
{ {
qWarning() << "User config directory does not exist: " << us erDir; qWarning() << "User config directory does not exist: " << QD ir::toNativeSeparators(userDir);
} }
try try
{ {
makeSureDirExistsAndIsWritable(userDir); makeSureDirExistsAndIsWritable(userDir);
} }
catch (std::runtime_error &e) catch (std::runtime_error &e)
{ {
qFatal("Error: cannot create user config directory: %s", e.w hat()); qFatal("Error: cannot create user config directory: %s", e.w hat());
} }
skipping to change at line 412 skipping to change at line 412
QFileInfo checkFile(QFile::decodeName(INSTALL_DATADIR "/" CHECK_FILE )); QFileInfo checkFile(QFile::decodeName(INSTALL_DATADIR "/" CHECK_FILE ));
#endif #endif
if (checkFile.exists()) if (checkFile.exists())
{ {
return installLocation.filePath(); return installLocation.filePath();
} }
else else
{ {
qWarning() << "WARNING StelFileMgr::StelFileMgr: could not f ind install location:" qWarning() << "WARNING StelFileMgr::StelFileMgr: could not f ind install location:"
<< installLocation.filePath() << " (we checked for " << QDir::toNativeSeparators(installLocation.filePath
<< checkFile.filePath() << ")."; ())
<< " (we checked for " << QDir::toNativeSeparators(c
heckFile.filePath())
<< ").";
throw (std::runtime_error("NOT FOUND")); throw (std::runtime_error("NOT FOUND"));
} }
} }
QString StelFileMgr::getScreenshotDir() QString StelFileMgr::getScreenshotDir()
{ {
return screenshotDir; return screenshotDir;
} }
void StelFileMgr::setScreenshotDir(const QString& newDir) void StelFileMgr::setScreenshotDir(const QString& newDir)
{ {
QFileInfo userDirFI(newDir); QFileInfo userDirFI(newDir);
if (!userDirFI.exists() || !userDirFI.isDir()) if (!userDirFI.exists() || !userDirFI.isDir())
{ {
qWarning() << "WARNING StelFileMgr::setScreenshotDir dir doe s not exist: " << userDirFI.filePath(); qWarning() << "WARNING StelFileMgr::setScreenshotDir dir doe s not exist: " << QDir::toNativeSeparators(userDirFI.filePath());
throw std::runtime_error("NOT_VALID"); throw std::runtime_error("NOT_VALID");
} }
else if (!userDirFI.isWritable()) else if (!userDirFI.isWritable())
{ {
qWarning() << "WARNING StelFileMgr::setScreenshotDir dir is not writable: " << userDirFI.filePath(); qWarning() << "WARNING StelFileMgr::setScreenshotDir dir is not writable: " << QDir::toNativeSeparators(userDirFI.filePath());
throw std::runtime_error("NOT_VALID"); 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 localePath;
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) #if defined(Q_OS_WIN) || defined(Q_OS_MAC)
skipping to change at line 491 skipping to change at line 493
return cachePath; return cachePath;
} }
void StelFileMgr::makeSureDirExistsAndIsWritable(const QString& dirFullPath ) void StelFileMgr::makeSureDirExistsAndIsWritable(const QString& dirFullPath )
{ {
// Check that the dirFullPath directory exists // Check that the dirFullPath directory exists
QFileInfo uDir(dirFullPath); QFileInfo uDir(dirFullPath);
if (!uDir.exists()) if (!uDir.exists())
{ {
// The modules directory doesn't exist, lets create it. // The modules directory doesn't exist, lets create it.
qDebug() << "Creating directory " << uDir.filePath(); qDebug() << "Creating directory " << QDir::toNativeSeparator s(uDir.filePath());
if (!QDir("/").mkpath(uDir.filePath())) if (!QDir("/").mkpath(uDir.filePath()))
{ {
throw std::runtime_error(QString("Could not create d irectory: " +uDir.filePath()).toStdString()); throw std::runtime_error(QString("Could not create d irectory: " +uDir.filePath()).toStdString());
} }
QFileInfo uDir2(dirFullPath); QFileInfo uDir2(dirFullPath);
if (!uDir2.isWritable()) if (!uDir2.isWritable())
{ {
throw std::runtime_error(QString("Directory is not w ritable: " +uDir2.filePath()).toStdString()); throw std::runtime_error(QString("Directory is not w ritable: " +uDir2.filePath()).toStdString());
} }
} }
 End of changes. 5 change blocks. 
6 lines changed or deleted 9 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/