| 1942 | } |
| 1943 | |
| 1944 | bool 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 | |
| 1974 | void NetworkDiagnosticsDialog::appendNewLogData() |
| 1975 | { |
nothing calls this directly
no test coverage detected