Commit 3e0de033 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Use system temp path from QStandardPaths

parent 9e0e602c
......@@ -14,6 +14,7 @@
#include <KLocalizedString>
#include "Options.h"
#include "auxiliary/kspaths.h"
#include "offlineastrometryparser.h"
#include "align.h"
......@@ -182,7 +183,7 @@ bool OfflineAstrometryParser::startSovler(const QString &filename, const QStrin
#endif
QStringList solverArgs = args;
QString solutionFile = QStandardPaths::TempLocation + "/solution.wcs";
QString solutionFile = KSPaths::writableLocation(QStandardPaths::TempLocation) + "solution.wcs";
solverArgs << "-W" << solutionFile << filename;
connect(&solver, SIGNAL(finished(int)), this, SLOT(solverComplete(int)));
......@@ -219,7 +220,7 @@ void OfflineAstrometryParser::solverComplete(int exist_status)
solver.disconnect();
// TODO use QTemporaryFile later
QString solutionFile = QStandardPaths::TempLocation + "/solution.wcs";
QString solutionFile = KSPaths::writableLocation(QStandardPaths::TempLocation) + "solution.wcs";
QFileInfo solution(solutionFile);
if (exist_status != 0 || solution.exists() == false)
......@@ -280,7 +281,8 @@ void OfflineAstrometryParser::wcsinfoComplete(int exist_status)
emit solverFinished(orientation,ra,dec, pixscale);
// Remove files left over by the solver
QDir dir("/tmp");
//QDir dir("/tmp");
QDir dir(KSPaths::writableLocation(QStandardPaths::TempLocation));
dir.setNameFilters(QStringList() << "fits*" << "tmp.*");
dir.setFilter(QDir::Files);
foreach(QString dirFile, dir.entryList())
......@@ -288,7 +290,6 @@ void OfflineAstrometryParser::wcsinfoComplete(int exist_status)
}
void OfflineAstrometryParser::logSolver()
{
if (Options::solverVerbose())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment