Commit 166ed9fa authored by Don Gagne's avatar Don Gagne

Add deleteTempLogFiles method

parent 1903e1f8
......@@ -757,3 +757,15 @@ void MAVLinkProtocol::suspendLogForReplay(bool suspend)
_logSuspendReplay = suspend;
}
void MAVLinkProtocol::deleteTempLogFiles(void)
{
QDir tempDir(QStandardPaths::writableLocation(QStandardPaths::TempLocation));
QString filter(QString("*.%1").arg(_logFileExtension));
QFileInfoList fileInfoList = tempDir.entryInfoList(QStringList(filter), QDir::Files);
foreach(const QFileInfo fileInfo, fileInfoList) {
QFile::remove(fileInfo.filePath());
}
}
......@@ -199,6 +199,9 @@ public slots:
/// and not called directly in order to synchronize with the bytesReady signal
/// which may be ahead of it in the signal queue.
void suspendLogForReplay(bool suspend);
/// @brief Deletes any log files which are in the temp directory
static void deleteTempLogFiles(void);
protected:
// Override from QObject
......
Markdown is supported
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