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

Add deleteTempLogFiles method

parent 1903e1f8
...@@ -757,3 +757,15 @@ void MAVLinkProtocol::suspendLogForReplay(bool suspend) ...@@ -757,3 +757,15 @@ void MAVLinkProtocol::suspendLogForReplay(bool suspend)
_logSuspendReplay = 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());
}
}
...@@ -200,6 +200,9 @@ public slots: ...@@ -200,6 +200,9 @@ public slots:
/// which may be ahead of it in the signal queue. /// which may be ahead of it in the signal queue.
void suspendLogForReplay(bool suspend); void suspendLogForReplay(bool suspend);
/// @brief Deletes any log files which are in the temp directory
static void deleteTempLogFiles(void);
protected: protected:
// Override from QObject // Override from QObject
virtual void connectNotify(const QMetaMethod& signal); virtual void connectNotify(const QMetaMethod& signal);
......
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