mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-01-21 04:55:32 -05:00
Merge pull request #2588 from f4exb/fix-2560
FT8 demod: create logs and save directories if they do not exist. Fixes #2560
This commit is contained in:
commit
005ef9973b
@ -162,6 +162,16 @@ FT8DemodWorker::FT8DemodWorker() :
|
||||
relPath = "ft8/logs";
|
||||
m_logsPath = dir.absolutePath() + "/" + relPath;
|
||||
qDebug("FT8DemodWorker::FT8DemodWorker: logs path: %s", qPrintable(m_logsPath));
|
||||
|
||||
QDir samplesDir(m_samplesPath);
|
||||
if (!samplesDir.exists()) {
|
||||
samplesDir.mkpath(".");
|
||||
}
|
||||
|
||||
QDir logsDir(m_logsPath);
|
||||
if (!logsDir.exists()) {
|
||||
logsDir.mkpath(".");
|
||||
}
|
||||
}
|
||||
|
||||
FT8DemodWorker::~FT8DemodWorker()
|
||||
@ -270,6 +280,12 @@ void FT8DemodWorker::processBuffer(int16_t *buffer, QDateTime periodTS)
|
||||
logMessage.remove(0, 2);
|
||||
logFile << logMessage.toStdString() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logFile.is_open()) {
|
||||
logFile.close();
|
||||
}
|
||||
}
|
||||
|
||||
if (mapPipes.size() > 0)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user