summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-23 17:59:09 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-23 17:59:09 (GMT)
commitb3633c3dcf767d97eeeafa0782c4a571b3410a9e (patch)
treea47345733a5f1f7a921f79d4cbc7abf5703e60a5
parent77352b6e5b0e45db5912b385e68484355ade41ee (diff)
Better use QDir::tempPath() directly. Also monitor if process was started at all or if an error occured and handle it
-rw-r--r--kstars/ekos/align/offlineastrometryparser.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/kstars/ekos/align/offlineastrometryparser.cpp b/kstars/ekos/align/offlineastrometryparser.cpp
index f728003..c7a369b 100644
--- a/kstars/ekos/align/offlineastrometryparser.cpp
+++ b/kstars/ekos/align/offlineastrometryparser.cpp
@@ -45,6 +45,14 @@ OfflineAstrometryParser::OfflineAstrometryParser() : AstrometryParser()
astrometryIndex[2000] = "index-4219";
astrometryFilesOK = false;
+
+ connect(&solver, SIGNAL(finished(int)), this, SLOT(solverComplete(int)));
+ connect(&solver, SIGNAL(readyReadStandardOutput()), this, SLOT(logSolver()));
+ connect(&solver, &QProcess::errorOccurred, this, [&]()
+ {
+ align->appendLogText(i18n("Error starting solver: %1", solver.errorString()));
+ emit solverFailed();
+ });
}
OfflineAstrometryParser::~OfflineAstrometryParser()
@@ -183,12 +191,9 @@ bool OfflineAstrometryParser::startSovler(const QString &filename, const QStrin
#endif
QStringList solverArgs = args;
- QString solutionFile = KSPaths::writableLocation(QStandardPaths::TempLocation) + "solution.wcs";
+ QString solutionFile = QDir::tempPath() + "/solution.wcs";
solverArgs << "-W" << solutionFile << filename;
- connect(&solver, SIGNAL(finished(int)), this, SLOT(solverComplete(int)));
- connect(&solver, SIGNAL(readyReadStandardOutput()), this, SLOT(logSolver()));
-
fitsFile = filename;
solverTimer.start();
@@ -212,7 +217,6 @@ bool OfflineAstrometryParser::stopSolver()
solver.disconnect();
return true;
-
}
void OfflineAstrometryParser::solverComplete(int exist_status)
@@ -220,7 +224,7 @@ void OfflineAstrometryParser::solverComplete(int exist_status)
solver.disconnect();
// TODO use QTemporaryFile later
- QString solutionFile = KSPaths::writableLocation(QStandardPaths::TempLocation) + "solution.wcs";
+ QString solutionFile = QDir::tempPath() + "/solution.wcs";
QFileInfo solution(solutionFile);
if (exist_status != 0 || solution.exists() == false)
@@ -282,7 +286,7 @@ void OfflineAstrometryParser::wcsinfoComplete(int exist_status)
// Remove files left over by the solver
//QDir dir("/tmp");
- QDir dir(KSPaths::writableLocation(QStandardPaths::TempLocation));
+ QDir dir(QDir::tempPath());
dir.setNameFilters(QStringList() << "fits*" << "tmp.*");
dir.setFilter(QDir::Files);
foreach(QString dirFile, dir.entryList())