MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / reopenLogFile

Method reopenLogFile

src/gui/NetworkDiagnosticsDialog.cpp:1944–1972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1942}
1943
1944bool NetworkDiagnosticsDialog::reopenLogFile(bool keepExistingLines)
1945{
1946 const QString logPath = LogManager::instance().logFilePath();
1947 if (m_logPathLabel) {
1948 m_logPathLabel->setText(QString("Log: %1").arg(logPath));
1949 }
1950
1951 m_logFile.close();
1952 m_logFile.setFileName(logPath);
1953 m_logOffset = 0;
1954 m_logPartialLine.clear();
1955 if (!keepExistingLines) {
1956 m_logLines.clear();
1957 if (m_logViewer) {
1958 m_logViewer->clear();
1959 }
1960 }
1961
1962 if (!m_logFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
1963 if (m_lastReopenFailurePath != logPath) {
1964 addLogLine(QString("[--:--:--.---] WRN default: Unable to open log file: %1").arg(logPath));
1965 m_lastReopenFailurePath = logPath;
1966 }
1967 return false;
1968 }
1969
1970 m_lastReopenFailurePath.clear();
1971 return true;
1972}
1973
1974void NetworkDiagnosticsDialog::appendNewLogData()
1975{

Callers

nothing calls this directly

Calls 4

logFilePathMethod · 0.45
closeMethod · 0.45
clearMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected