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

Method refreshLog

src/gui/SupportDialog.cpp:317–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void SupportDialog::refreshLog()
318{
319 auto& mgr = LogManager::instance();
320 m_sizeLabel->setText(formatFileSize(mgr.logFileSize()));
321
322 QFile f(mgr.logFilePath());
323 if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
324 m_logViewer->setPlainText("(unable to open log file)");
325 return;
326 }
327
328 // Read last 200KB max to keep UI responsive
329 constexpr qint64 MAX_READ = 200 * 1024;
330 if (f.size() > MAX_READ)
331 f.seek(f.size() - MAX_READ);
332
333 m_logViewer->setPlainText(QString::fromUtf8(f.readAll()));
334 f.close();
335
336 // Scroll to bottom
337 auto* sb = m_logViewer->verticalScrollBar();
338 sb->setValue(sb->maximum());
339}
340
341void SupportDialog::clearLog()
342{

Callers

nothing calls this directly

Calls 6

logFileSizeMethod · 0.80
logFilePathMethod · 0.45
openMethod · 0.45
sizeMethod · 0.45
closeMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected