From baecc05ef28579b5f436f3f6202e2d1a8c8ffdfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Thu, 18 Dec 2025 13:59:43 +0100 Subject: [PATCH 01/13] Fix #14290 (GUI: detailed progress view that shows what files the threads are working on) --- .selfcheck_suppressions | 2 +- gui/checkthread.cpp | 23 ++++++++++--- gui/checkthread.h | 16 +++++++-- gui/gui.pro | 5 ++- gui/mainwindow.cpp | 14 ++++++++ gui/mainwindow.h | 3 ++ gui/mainwindow.ui | 19 ++++++++--- gui/test/resultstree/testresultstree.cpp | 11 +++++- gui/threaddetails.cpp | 31 +++++++++++++++++ gui/threaddetails.h | 32 ++++++++++++++++++ gui/threaddetails.ui | 43 ++++++++++++++++++++++++ gui/threadhandler.cpp | 38 ++++++++++++++++++--- gui/threadhandler.h | 29 ++++++++++++++++ gui/threadresult.cpp | 5 +-- gui/threadresult.h | 8 +++-- 15 files changed, 253 insertions(+), 26 deletions(-) create mode 100644 gui/threaddetails.cpp create mode 100644 gui/threaddetails.h create mode 100644 gui/threaddetails.ui diff --git a/.selfcheck_suppressions b/.selfcheck_suppressions index 764b8818308..cdac1ba33ab 100644 --- a/.selfcheck_suppressions +++ b/.selfcheck_suppressions @@ -12,7 +12,7 @@ funcArgNamesDifferent:*/moc_resultsview.cpp funcArgNamesDifferent:*/moc_threadhandler.cpp funcArgNamesDifferent:*/moc_threadresult.cpp naming-varname:*/gui/ui_*.h -functionStatic:*/ui_fileview.h +functionStatic:*/gui/ui_*.h # --debug-warnings suppressions valueFlowBailout diff --git a/gui/checkthread.cpp b/gui/checkthread.cpp index e10bf1ddf5a..ab20602a09b 100644 --- a/gui/checkthread.cpp +++ b/gui/checkthread.cpp @@ -105,8 +105,9 @@ int CheckThread::executeCommand(std::string exe, std::vector args, } -CheckThread::CheckThread(ThreadResult &result) : - mResult(result) +CheckThread::CheckThread(ThreadResult &result, int threadIndex) + : mResult(result) + , mThreadIndex(threadIndex) {} void CheckThread::setSettings(const Settings &settings, std::shared_ptr supprs) @@ -147,9 +148,14 @@ void CheckThread::run() while (file && mState == Running) { const std::string& fname = file->spath(); qDebug() << "Checking file" << QString::fromStdString(fname); + + const Details details{ mThreadIndex, QString::fromStdString(fname), QTime::currentTime(), }; + emit startCheck(details); + cppcheck.check(*file); runAddonsAndTools(mSettings, nullptr, QString::fromStdString(fname)); - emit fileChecked(QString::fromStdString(fname)); + + emit finishCheck(details); if (mState == Running) mResult.getNextFile(file); @@ -160,9 +166,15 @@ void CheckThread::run() while (fileSettings && mState == Running) { const std::string& fname = fileSettings->filename(); qDebug() << "Checking file" << QString::fromStdString(fname); - cppcheck.check(*fileSettings); + + const Details details{ mThreadIndex, QString::fromStdString(fname), QTime::currentTime(), }; + emit startCheck(details); + + cppcheck.check(*file); runAddonsAndTools(mSettings, fileSettings, QString::fromStdString(fname)); - emit fileChecked(QString::fromStdString(fname)); + + emit finishCheck(details); + if (mState == Running) mResult.getNextFileSettings(fileSettings); @@ -486,3 +498,4 @@ QString CheckThread::clangTidyCmd() return QString(); } + diff --git a/gui/checkthread.h b/gui/checkthread.h index 4247a45094c..ba8953b8ddf 100644 --- a/gui/checkthread.h +++ b/gui/checkthread.h @@ -36,6 +36,7 @@ #include #include #include +#include class ThreadResult; @@ -48,8 +49,16 @@ class ThreadResult; */ class CheckThread : public QThread { Q_OBJECT + +public: + struct Details { + int threadIndex; + QString file; + QTime startTime; + }; + public: - explicit CheckThread(ThreadResult &result); + CheckThread(ThreadResult &result, int threadIndex); /** * @brief Set settings for cppcheck @@ -102,8 +111,8 @@ class CheckThread : public QThread { */ void done(); - // NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) - caused by generated MOC code - void fileChecked(const QString &file); + void startCheck(CheckThread::Details details); + void finishCheck(CheckThread::Details details); protected: /** @@ -126,6 +135,7 @@ class CheckThread : public QThread { std::atomic mState{Ready}; ThreadResult &mResult; + int mThreadIndex{}; Settings mSettings; std::shared_ptr mSuppressions; diff --git a/gui/gui.pro b/gui/gui.pro index 132f113d270..8706e86c86e 100644 --- a/gui/gui.pro +++ b/gui/gui.pro @@ -70,7 +70,8 @@ FORMS = about.ui \ librarydialog.ui \ libraryaddfunctiondialog.ui \ libraryeditargdialog.ui \ - newsuppressiondialog.ui + newsuppressiondialog.ui \ + threaddetails.ui TRANSLATIONS = cppcheck_de.ts \ cppcheck_es.ts \ @@ -156,6 +157,7 @@ HEADERS += aboutdialog.h \ settingsdialog.h \ showtypes.h \ statsdialog.h \ + threaddetails.h \ threadhandler.h \ threadresult.h \ translationhandler.h \ @@ -199,6 +201,7 @@ SOURCES += aboutdialog.cpp \ settingsdialog.cpp \ showtypes.cpp \ statsdialog.cpp \ + threaddetails.cpp \ threadhandler.cpp \ threadresult.cpp \ translationhandler.cpp \ diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 6d0a1a8d5ce..ea8b35473d1 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -53,6 +53,7 @@ #include "threadresult.h" #include "translationhandler.h" #include "utils.h" +#include "threaddetails.h" #include "ui_mainwindow.h" @@ -183,6 +184,7 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) : connect(mUI->mActionShowHidden, &QAction::triggered, mUI->mResults, &ResultsView::showHiddenResults); connect(mUI->mActionViewStats, &QAction::triggered, this, &MainWindow::showStatistics); connect(mUI->mActionLibraryEditor, &QAction::triggered, this, &MainWindow::showLibraryEditor); + connect(mUI->mActionShowThreadDetails, &QAction::triggered, this, &MainWindow::showThreadDetails); connect(mUI->mActionReanalyzeModified, &QAction::triggered, this, &MainWindow::reAnalyzeModified); connect(mUI->mActionReanalyzeAll, &QAction::triggered, this, &MainWindow::reAnalyzeAll); @@ -2109,6 +2111,18 @@ void MainWindow::showLibraryEditor() libraryDialog.exec(); } +void MainWindow::showThreadDetails() +{ + if (ThreadDetails::instance()) + return; + auto* threadDetails = new ThreadDetails(this); + connect(mThread, &ThreadHandler::threadDetailsUpdated, + threadDetails, &ThreadDetails::threadDetailsUpdated, Qt::QueuedConnection); + threadDetails->setAttribute(Qt::WA_DeleteOnClose); + threadDetails->show(); + mThread->emitThreadDetailsUpdated(); +} + void MainWindow::filterResults() { mUI->mResults->filterResults(mLineEditFilter->text()); diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 76fda4f0de6..e29d4d48f5b 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -200,6 +200,9 @@ public slots: /** @brief Slot for showing the library editor */ void showLibraryEditor(); + /** @brief Slot for showing the thread details window */ + void showThreadDetails(); + private slots: /** @brief Slot for checkthread's done signal */ diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index a90949344e2..551874d3225 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -64,7 +64,7 @@ - QLayout::SetDefaultConstraint + QLayout::SizeConstraint::SetDefaultConstraint @@ -84,13 +84,13 @@ Checking for updates - Qt::RichText + Qt::TextFormat::RichText true - Qt::TextBrowserInteraction + Qt::TextInteractionFlag::TextBrowserInteraction @@ -104,7 +104,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -124,7 +124,7 @@ 0 0 640 - 22 + 21 @@ -192,6 +192,7 @@ + @@ -1040,6 +1041,14 @@ EULA... + + + Thread Details + + + Show thread details + + diff --git a/gui/test/resultstree/testresultstree.cpp b/gui/test/resultstree/testresultstree.cpp index 732ee0715d0..3b3949539e3 100644 --- a/gui/test/resultstree/testresultstree.cpp +++ b/gui/test/resultstree/testresultstree.cpp @@ -93,6 +93,14 @@ void ThreadHandler::stop() { void ThreadHandler::threadDone() { throw 1; } +// NOLINTBEGIN(performance-unnecessary-value-param) +void ThreadHandler::startCheck(CheckThread::Details /*unused*/) { + throw 1; +} +void ThreadHandler::finishCheck(CheckThread::Details /*unused*/) { + throw 1; +} +// NOLINTEND(performance-unnecessary-value-param) Application& ApplicationList::getApplication(const int /*unused*/) { throw 1; } @@ -106,7 +114,8 @@ QString XmlReport::unquoteMessage(const QString &message) { return message; } XmlReport::XmlReport(const QString& filename) : Report(filename) {} -void ThreadResult::fileChecked(const QString & /*unused*/) { +// NOLINTNEXTLINE(performance-unnecessary-value-param) +void ThreadResult::finishCheck(CheckThread::Details /*unused*/) { throw 1; } void ThreadResult::reportOut(const std::string & /*unused*/, Color /*unused*/) { diff --git a/gui/threaddetails.cpp b/gui/threaddetails.cpp new file mode 100644 index 00000000000..9582d1b2eb8 --- /dev/null +++ b/gui/threaddetails.cpp @@ -0,0 +1,31 @@ +#include "threaddetails.h" +#include "ui_threaddetails.h" + +ThreadDetails* ThreadDetails::mInstance; + +ThreadDetails::ThreadDetails(QWidget *parent) + : QWidget(parent) + , mUi(new Ui::ThreadDetails) +{ + mInstance = this; + setWindowFlags(Qt::Window); + mUi->setupUi(this); +} + +ThreadDetails::~ThreadDetails() +{ + mInstance = nullptr; + delete mUi; +} + +void ThreadDetails::threadDetailsUpdated(QMap threadDetails) +{ + mUi->tableWidget->setRowCount(threadDetails.size()); + int row = 0; + for (const auto& td: threadDetails) { + mUi->tableWidget->setItem(row, 0, new QTableWidgetItem(QString::number(td.threadIndex))); + mUi->tableWidget->setItem(row, 1, new QTableWidgetItem(QString(td.startTime.toString(Qt::TextDate)))); + mUi->tableWidget->setItem(row, 2, new QTableWidgetItem(td.file)); + ++row; + } +} diff --git a/gui/threaddetails.h b/gui/threaddetails.h new file mode 100644 index 00000000000..7e0795ed77c --- /dev/null +++ b/gui/threaddetails.h @@ -0,0 +1,32 @@ +#ifndef THREADDETAILS_H +#define THREADDETAILS_H + +#include +#include +#include "checkthread.h" + +namespace Ui { + class ThreadDetails; +} + +class ThreadDetails : public QWidget +{ + Q_OBJECT + +public: + explicit ThreadDetails(QWidget *parent = nullptr); + ~ThreadDetails() override; + + static ThreadDetails* instance() { + return mInstance; + } + +public slots: + void threadDetailsUpdated(QMap threadDetails); + +private: + static ThreadDetails* mInstance; + Ui::ThreadDetails *mUi; +}; + +#endif // THREADDETAILS_H diff --git a/gui/threaddetails.ui b/gui/threaddetails.ui new file mode 100644 index 00000000000..d10013b710f --- /dev/null +++ b/gui/threaddetails.ui @@ -0,0 +1,43 @@ + + + ThreadDetails + + + + 0 + 0 + 640 + 300 + + + + Thread Details + + + + + + false + + + + Thread + + + + + Start time + + + + + Filename + + + + + + + + + diff --git a/gui/threadhandler.cpp b/gui/threadhandler.cpp index ad4d0e2a61d..20c58428e37 100644 --- a/gui/threadhandler.cpp +++ b/gui/threadhandler.cpp @@ -146,11 +146,15 @@ void ThreadHandler::createThreads(const int count) removeThreads(); //Create new threads for (int i = mThreads.size(); i < count; i++) { - mThreads << new CheckThread(mResults); + mThreads << new CheckThread(mResults, i + 1); connect(mThreads.last(), &CheckThread::done, this, &ThreadHandler::threadDone, Qt::QueuedConnection); - connect(mThreads.last(), &CheckThread::fileChecked, - &mResults, &ThreadResult::fileChecked, Qt::QueuedConnection); + connect(mThreads.last(), &CheckThread::finishCheck, + &mResults, &ThreadResult::finishCheck, Qt::QueuedConnection); + connect(mThreads.last(), &CheckThread::startCheck, + this, &ThreadHandler::startCheck, Qt::QueuedConnection); + connect(mThreads.last(), &CheckThread::finishCheck, + this, &ThreadHandler::finishCheck, Qt::QueuedConnection); } } @@ -164,8 +168,12 @@ void ThreadHandler::removeThreads() } disconnect(thread, &CheckThread::done, this, &ThreadHandler::threadDone); - disconnect(thread, &CheckThread::fileChecked, - &mResults, &ThreadResult::fileChecked); + disconnect(thread, &CheckThread::finishCheck, + &mResults, &ThreadResult::finishCheck); + disconnect(mThreads.last(), &CheckThread::startCheck, + this, &ThreadHandler::startCheck); + disconnect(mThreads.last(), &CheckThread::finishCheck, + this, &ThreadHandler::finishCheck); delete thread; } @@ -317,3 +325,23 @@ void ThreadHandler::setCheckStartTime(QDateTime checkStartTime) { mCheckStartTime = std::move(checkStartTime); } + +// cppcheck-suppress passedByValueCallback +// NOLINTNEXTLINE(performance-unnecessary-value-param) +void ThreadHandler::startCheck(CheckThread::Details details) +{ + mThreadDetails[details.threadIndex] = details; + emitThreadDetailsUpdated(); +} + +// NOLINTNEXTLINE(performance-unnecessary-value-param) +void ThreadHandler::finishCheck(CheckThread::Details details) +{ + mThreadDetails.remove(details.threadIndex); + emitThreadDetailsUpdated(); +} + +void ThreadHandler::emitThreadDetailsUpdated() +{ + emit threadDetailsUpdated(mThreadDetails); +} diff --git a/gui/threadhandler.h b/gui/threadhandler.h index cc578bd5643..1b2b108bd40 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -178,6 +178,11 @@ class ThreadHandler : public QObject { */ void setCheckStartTime(QDateTime checkStartTime); + /** + * @brief Emit the threadDetailsUpdated signal + */ + void emitThreadDetailsUpdated(); + signals: /** * @brief Signal that all threads are done @@ -191,6 +196,11 @@ class ThreadHandler : public QObject { // NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) - caused by generated MOC code void debugError(const ErrorItem &item); + /** + * @brief Emitted when thread details are updated. + */ + void threadDetailsUpdated(QMap threadDetails); + public slots: /** @@ -198,6 +208,19 @@ public slots: * */ void stop(); + + /** + * @brief Slot threads use to signal this class that it started checking a file + * @param details Details about what file is being checked and by what thread + */ + void startCheck(CheckThread::Details details); + + /** + * @brief Slot threads use to signal this class that it finish checking a file + * @param details Details about what file finished being checked and by what thread + */ + void finishCheck(CheckThread::Details details); + protected slots: /** * @brief Slot that a single thread is done @@ -285,6 +308,12 @@ protected slots: Settings mCheckSettings; std::shared_ptr mCheckSuppressions; /// @} + + /** + * @bried Details about currently running threads + */ + QMap mThreadDetails; + private: /** diff --git a/gui/threadresult.cpp b/gui/threadresult.cpp index ea858c92e4a..06399ccb528 100644 --- a/gui/threadresult.cpp +++ b/gui/threadresult.cpp @@ -34,11 +34,12 @@ void ThreadResult::reportOut(const std::string &outmsg, Color /*c*/) emit log(QString::fromStdString(outmsg)); } -void ThreadResult::fileChecked(const QString &file) +// NOLINTNEXTLINE(performance-unnecessary-value-param) +void ThreadResult::finishCheck(CheckThread::Details details) { std::lock_guard locker(mutex); - mProgress += QFile(file).size(); + mProgress += QFile(details.file).size(); mFilesChecked++; if (mMaxProgress > 0) { diff --git a/gui/threadresult.h b/gui/threadresult.h index dc7b5c0372a..4b7b74e4e9d 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -23,6 +23,7 @@ #include "color.h" #include "errorlogger.h" #include "filesettings.h" +#include "checkthread.h" #include #include @@ -87,10 +88,11 @@ class ThreadResult : public QObject, public ErrorLogger { public slots: /** - * @brief Slot threads use to signal this class that a specific file is checked - * @param file File that is checked + * @brief Slot threads use to signal this class that it finish checking a file + * @param details Details about what file finished being checked and by what thread */ - void fileChecked(const QString &file); + void finishCheck(CheckThread::Details details); + signals: /** * @brief Progress signal From e9726dda9856601be95443312ddff957bf9bbb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 14 Feb 2026 18:29:46 +0100 Subject: [PATCH 02/13] bried->brief --- gui/threadhandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/threadhandler.h b/gui/threadhandler.h index 1b2b108bd40..c82647846ee 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -310,7 +310,7 @@ protected slots: /// @} /** - * @bried Details about currently running threads + * @brief Details about currently running threads */ QMap mThreadDetails; From fef127755f372215c08b3be370c73feaf5cfa40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 14 Feb 2026 19:17:09 +0100 Subject: [PATCH 03/13] try to fix CI --- gui/threaddetails.cpp | 9 +++------ gui/threaddetails.ui | 23 ++++------------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/gui/threaddetails.cpp b/gui/threaddetails.cpp index 9582d1b2eb8..8018bcd2e55 100644 --- a/gui/threaddetails.cpp +++ b/gui/threaddetails.cpp @@ -20,12 +20,9 @@ ThreadDetails::~ThreadDetails() void ThreadDetails::threadDetailsUpdated(QMap threadDetails) { - mUi->tableWidget->setRowCount(threadDetails.size()); - int row = 0; + QString text("Thread\tStart time\tFile\n"); for (const auto& td: threadDetails) { - mUi->tableWidget->setItem(row, 0, new QTableWidgetItem(QString::number(td.threadIndex))); - mUi->tableWidget->setItem(row, 1, new QTableWidgetItem(QString(td.startTime.toString(Qt::TextDate)))); - mUi->tableWidget->setItem(row, 2, new QTableWidgetItem(td.file)); - ++row; + text += QString("%1\t%2\t%3\n").arg(td.threadIndex).arg(td.startTime.toString(Qt::TextDate)).arg(td.file); } + mUi->plainTextEdit->setPlainText(text); } diff --git a/gui/threaddetails.ui b/gui/threaddetails.ui index d10013b710f..420340cf77d 100644 --- a/gui/threaddetails.ui +++ b/gui/threaddetails.ui @@ -15,25 +15,10 @@ - - - false - - - - Thread - - - - - Start time - - - - - Filename - - + + + true + From cacd7d34c0e9722551bf05d1aabfc86dcd917148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 15 Feb 2026 07:43:18 +0100 Subject: [PATCH 04/13] selfcheck --- gui/threaddetails.cpp | 2 +- gui/threaddetails.h | 2 +- gui/threadhandler.cpp | 4 ++-- gui/threadhandler.h | 4 ++-- gui/threadresult.cpp | 2 +- gui/threadresult.h | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gui/threaddetails.cpp b/gui/threaddetails.cpp index 8018bcd2e55..9a3c5f914ee 100644 --- a/gui/threaddetails.cpp +++ b/gui/threaddetails.cpp @@ -18,7 +18,7 @@ ThreadDetails::~ThreadDetails() delete mUi; } -void ThreadDetails::threadDetailsUpdated(QMap threadDetails) +void ThreadDetails::threadDetailsUpdated(const QMap& threadDetails) { QString text("Thread\tStart time\tFile\n"); for (const auto& td: threadDetails) { diff --git a/gui/threaddetails.h b/gui/threaddetails.h index 7e0795ed77c..2226b6b6441 100644 --- a/gui/threaddetails.h +++ b/gui/threaddetails.h @@ -22,7 +22,7 @@ class ThreadDetails : public QWidget } public slots: - void threadDetailsUpdated(QMap threadDetails); + void threadDetailsUpdated(const QMap& threadDetails); private: static ThreadDetails* mInstance; diff --git a/gui/threadhandler.cpp b/gui/threadhandler.cpp index 20c58428e37..e11768aaac3 100644 --- a/gui/threadhandler.cpp +++ b/gui/threadhandler.cpp @@ -328,14 +328,14 @@ void ThreadHandler::setCheckStartTime(QDateTime checkStartTime) // cppcheck-suppress passedByValueCallback // NOLINTNEXTLINE(performance-unnecessary-value-param) -void ThreadHandler::startCheck(CheckThread::Details details) +void ThreadHandler::startCheck(const CheckThread::Details& details) { mThreadDetails[details.threadIndex] = details; emitThreadDetailsUpdated(); } // NOLINTNEXTLINE(performance-unnecessary-value-param) -void ThreadHandler::finishCheck(CheckThread::Details details) +void ThreadHandler::finishCheck(const CheckThread::Details& details) { mThreadDetails.remove(details.threadIndex); emitThreadDetailsUpdated(); diff --git a/gui/threadhandler.h b/gui/threadhandler.h index c82647846ee..f9c2b0b76a9 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -213,13 +213,13 @@ public slots: * @brief Slot threads use to signal this class that it started checking a file * @param details Details about what file is being checked and by what thread */ - void startCheck(CheckThread::Details details); + void startCheck(const CheckThread::Details& details); /** * @brief Slot threads use to signal this class that it finish checking a file * @param details Details about what file finished being checked and by what thread */ - void finishCheck(CheckThread::Details details); + void finishCheck(const CheckThread::Details& details); protected slots: /** diff --git a/gui/threadresult.cpp b/gui/threadresult.cpp index 06399ccb528..62f552d6853 100644 --- a/gui/threadresult.cpp +++ b/gui/threadresult.cpp @@ -35,7 +35,7 @@ void ThreadResult::reportOut(const std::string &outmsg, Color /*c*/) } // NOLINTNEXTLINE(performance-unnecessary-value-param) -void ThreadResult::finishCheck(CheckThread::Details details) +void ThreadResult::finishCheck(const CheckThread::Details& details) { std::lock_guard locker(mutex); diff --git a/gui/threadresult.h b/gui/threadresult.h index 4b7b74e4e9d..17dd9798201 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -91,13 +91,13 @@ public slots: * @brief Slot threads use to signal this class that it finish checking a file * @param details Details about what file finished being checked and by what thread */ - void finishCheck(CheckThread::Details details); + void finishCheck(const CheckThread::Details& details); signals: /** - * @brief Progress signal - * @param value Current progress - * @param description Description of the current stage + * @brief Files checked progress + * @param value Current progress (0 - PROGRESS_MAX) + * @param description Description of the current stage (example: 13/45 files checked) */ // NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) - caused by generated MOC code void progress(int value, const QString& description); From 8226a49960aa6c049bf6fd66eae3b397eebdd545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 15 Feb 2026 09:57:37 +0100 Subject: [PATCH 05/13] improved progress output. Show progress messages in the ThreadDetails --- gui/checkthread.h | 4 ++-- gui/mainwindow.cpp | 3 +++ gui/resultsview.cpp | 2 +- gui/resultsview.h | 2 +- gui/threaddetails.cpp | 29 ++++++++++++++++++++++++++--- gui/threaddetails.h | 12 ++++++++++++ gui/threadhandler.cpp | 7 +++++-- gui/threadhandler.h | 3 +++ gui/threadresult.cpp | 20 ++++++++++++-------- gui/threadresult.h | 21 +++++++++------------ 10 files changed, 74 insertions(+), 29 deletions(-) diff --git a/gui/checkthread.h b/gui/checkthread.h index ba8953b8ddf..2cfa255c16f 100644 --- a/gui/checkthread.h +++ b/gui/checkthread.h @@ -111,8 +111,8 @@ class CheckThread : public QThread { */ void done(); - void startCheck(CheckThread::Details details); - void finishCheck(CheckThread::Details details); + void startCheck(const CheckThread::Details& details); + void finishCheck(const CheckThread::Details& details); protected: /** diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index ea8b35473d1..c0d42a32d0d 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1071,6 +1071,7 @@ bool MainWindow::getCppcheckSettings(Settings& settings, Suppressions& supprs) settings.exename = QCoreApplication::applicationFilePath().toStdString(); settings.templateFormat = "{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]"; + settings.reportProgress = 10; // default to --check-level=normal for GUI for now settings.setCheckLevel(Settings::CheckLevel::normal); @@ -2118,6 +2119,8 @@ void MainWindow::showThreadDetails() auto* threadDetails = new ThreadDetails(this); connect(mThread, &ThreadHandler::threadDetailsUpdated, threadDetails, &ThreadDetails::threadDetailsUpdated, Qt::QueuedConnection); + connect(mThread, &ThreadHandler::progress, + threadDetails, &ThreadDetails::progress, Qt::QueuedConnection); threadDetails->setAttribute(Qt::WA_DeleteOnClose); threadDetails->show(); mThread->emitThreadDetailsUpdated(); diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index 8336a697878..b8ff3d8c598 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -162,7 +162,7 @@ void ResultsView::setResultsSource(ResultsTree::ResultsSource source) mUI->mTree->setResultsSource(source); } -void ResultsView::progress(int value, const QString& description) +void ResultsView::filesCheckedProgress(int value, const QString& description) { mUI->mProgress->setValue(value); mUI->mProgress->setFormat(QString("%p% (%1)").arg(description)); diff --git a/gui/resultsview.h b/gui/resultsview.h index 770f9c0c3fa..500d40df981 100644 --- a/gui/resultsview.h +++ b/gui/resultsview.h @@ -307,7 +307,7 @@ public slots: * @param value Current progress value * @param description Description to accompany the progress */ - void progress(int value, const QString& description); + void filesCheckedProgress(int value, const QString& description); /** * @brief Slot for new error to be displayed diff --git a/gui/threaddetails.cpp b/gui/threaddetails.cpp index 9a3c5f914ee..16ac72fea67 100644 --- a/gui/threaddetails.cpp +++ b/gui/threaddetails.cpp @@ -1,6 +1,8 @@ #include "threaddetails.h" #include "ui_threaddetails.h" +#include + ThreadDetails* ThreadDetails::mInstance; ThreadDetails::ThreadDetails(QWidget *parent) @@ -10,6 +12,8 @@ ThreadDetails::ThreadDetails(QWidget *parent) mInstance = this; setWindowFlags(Qt::Window); mUi->setupUi(this); + connect(&mTimer, &QTimer::timeout, this, &ThreadDetails::updateUI); + mTimer.start(1000); } ThreadDetails::~ThreadDetails() @@ -20,9 +24,28 @@ ThreadDetails::~ThreadDetails() void ThreadDetails::threadDetailsUpdated(const QMap& threadDetails) { - QString text("Thread\tStart time\tFile\n"); - for (const auto& td: threadDetails) { - text += QString("%1\t%2\t%3\n").arg(td.threadIndex).arg(td.startTime.toString(Qt::TextDate)).arg(td.file); + QMutexLocker locker(&mMutex); + mThreadDetails = threadDetails; + if (threadDetails.empty()) { + mProgress.clear(); + } +} + +void ThreadDetails::progress(const QString &filename, const QString& stage, const std::size_t value) { + QMutexLocker locker(&mMutex); + mProgress[filename] = {QString(), stage + QString(value > 0 ? ": %1%" : "").arg(value)}; +} + +void ThreadDetails::updateUI() { + QString text("Thread\tStart time\tFile/Progress\n"); + { + QMutexLocker locker(&mMutex); + for (const auto& td: mThreadDetails) { + auto& progress = mProgress[td.file]; + if (progress.first.isEmpty() && !progress.second.isEmpty()) + progress.first = QTime::currentTime().toString(Qt::TextDate); + text += QString("%1\t%2\t%3\n\t%4\t%5\n").arg(td.threadIndex).arg(td.startTime.toString(Qt::TextDate)).arg(td.file).arg(progress.first).arg(progress.second); + } } mUi->plainTextEdit->setPlainText(text); } diff --git a/gui/threaddetails.h b/gui/threaddetails.h index 2226b6b6441..d97ef669fc9 100644 --- a/gui/threaddetails.h +++ b/gui/threaddetails.h @@ -3,6 +3,8 @@ #include #include +#include +#include #include "checkthread.h" namespace Ui { @@ -23,10 +25,20 @@ class ThreadDetails : public QWidget public slots: void threadDetailsUpdated(const QMap& threadDetails); + void progress(const QString &filename, const QString& stage, const std::size_t value); + +private slots: + void updateUI(); private: static ThreadDetails* mInstance; Ui::ThreadDetails *mUi; + QMap> mProgress; + QMap mThreadDetails; + QTimer mTimer; + + /** accessing mProgress and mThreadDetails in slots that are triggered from different threads */ + QMutex mMutex; }; #endif // THREADDETAILS_H diff --git a/gui/threadhandler.cpp b/gui/threadhandler.cpp index e11768aaac3..787ae6179bc 100644 --- a/gui/threadhandler.cpp +++ b/gui/threadhandler.cpp @@ -223,8 +223,8 @@ void ThreadHandler::stop() void ThreadHandler::initialize(const ResultsView *view) { - connect(&mResults, &ThreadResult::progress, - view, &ResultsView::progress); + connect(&mResults, &ThreadResult::filesCheckedProgress, + view, &ResultsView::filesCheckedProgress); connect(&mResults, &ThreadResult::error, view, &ResultsView::error); @@ -234,6 +234,9 @@ void ThreadHandler::initialize(const ResultsView *view) connect(&mResults, &ThreadResult::debugError, this, &ThreadHandler::debugError); + + connect(&mResults, &ThreadResult::progress, + this, &ThreadHandler::progress); } void ThreadHandler::loadSettings(const QSettings &settings) diff --git a/gui/threadhandler.h b/gui/threadhandler.h index f9c2b0b76a9..1f9faecd853 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -221,6 +221,9 @@ public slots: */ void finishCheck(const CheckThread::Details& details); +signals: + void progress(const QString &filename, const QString& stage, const std::size_t value); + protected slots: /** * @brief Slot that a single thread is done diff --git a/gui/threadresult.cpp b/gui/threadresult.cpp index 62f552d6853..999177c49f7 100644 --- a/gui/threadresult.cpp +++ b/gui/threadresult.cpp @@ -39,14 +39,14 @@ void ThreadResult::finishCheck(const CheckThread::Details& details) { std::lock_guard locker(mutex); - mProgress += QFile(details.file).size(); + mCheckedFileSize += QFile(details.file).size(); mFilesChecked++; - if (mMaxProgress > 0) { - const int value = static_cast(PROGRESS_MAX * mProgress / mMaxProgress); + if (mTotalFileSize > 0) { + const int value = static_cast(PROGRESS_MAX * mCheckedFileSize / mTotalFileSize); const QString description = tr("%1 of %2 files checked").arg(mFilesChecked).arg(mTotalFiles); - emit progress(value, description); + emit filesCheckedProgress(value, description); } } @@ -60,6 +60,10 @@ void ThreadResult::reportErr(const ErrorMessage &msg) emit debugError(item); } +void ThreadResult::reportProgress(const std::string &filename, const char stage[], const std::size_t value) { + emit progress(QString::fromStdString(filename), stage, value); +} + void ThreadResult::getNextFile(const FileWithDetails*& file) { std::lock_guard locker(mutex); @@ -88,7 +92,7 @@ void ThreadResult::setFiles(std::list files) mTotalFiles = files.size(); mFiles = std::move(files); mItNextFile = mFiles.cbegin(); - mProgress = 0; + mCheckedFileSize = 0; mFilesChecked = 0; // Determine the total size of all of the files to check, so that we can @@ -96,7 +100,7 @@ void ThreadResult::setFiles(std::list files) quint64 sizeOfFiles = std::accumulate(mFiles.cbegin(), mFiles.cend(), 0, [](quint64 total, const FileWithDetails& file) { return total + file.size(); }); - mMaxProgress = sizeOfFiles; + mTotalFileSize = sizeOfFiles; } void ThreadResult::setProject(const ImportProject &prj) @@ -106,13 +110,13 @@ void ThreadResult::setProject(const ImportProject &prj) mItNextFile = mFiles.cbegin(); mFileSettings = prj.fileSettings; mItNextFileSettings = mFileSettings.cbegin(); - mProgress = 0; + mCheckedFileSize = 0; mFilesChecked = 0; mTotalFiles = prj.fileSettings.size(); // Determine the total size of all of the files to check, so that we can // show an accurate progress estimate - mMaxProgress = std::accumulate(prj.fileSettings.begin(), prj.fileSettings.end(), quint64{ 0 }, [](quint64 v, const FileSettings& fs) { + mTotalFileSize = std::accumulate(prj.fileSettings.begin(), prj.fileSettings.end(), quint64{ 0 }, [](quint64 v, const FileSettings& fs) { return v + QFile(QString::fromStdString(fs.filename())).size(); }); } diff --git a/gui/threadresult.h b/gui/threadresult.h index 17dd9798201..52f6cfefffe 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -84,6 +84,7 @@ class ThreadResult : public QObject, public ErrorLogger { { (void) metric; } + void reportProgress(const std::string &filename, const char stage[], const std::size_t value) override; public slots: @@ -97,10 +98,10 @@ public slots: /** * @brief Files checked progress * @param value Current progress (0 - PROGRESS_MAX) - * @param description Description of the current stage (example: 13/45 files checked) + * @param description Description of the current stage (example: "13/45 files checked") */ // NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) - caused by generated MOC code - void progress(int value, const QString& description); + void filesCheckedProgress(int value, const QString& description); /** * @brief Signal of a new error @@ -126,6 +127,8 @@ public slots: // NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) - caused by generated MOC code void debugError(const ErrorItem &item); + void progress(const QString &filename, const QString& stage, const std::size_t value); + protected: /** @@ -144,17 +147,11 @@ public slots: std::list mFileSettings; std::list::const_iterator mItNextFileSettings{mFileSettings.cbegin()}; - /** - * @brief Max progress - * - */ - quint64 mMaxProgress{}; + /** @brief Total file size */ + quint64 mTotalFileSize{}; - /** - * @brief Current progress - * - */ - quint64 mProgress{}; + /** @brief File size of checked files */ + quint64 mCheckedFileSize{}; /** * @brief Current number of files checked From 8edab9785198e61e93ec78115081ac036afb4404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 15 Feb 2026 12:26:58 +0100 Subject: [PATCH 06/13] Pass slot parameters by value --- gui/checkthread.h | 6 +++--- gui/threaddetails.cpp | 4 ++-- gui/threaddetails.h | 4 ++-- gui/threadhandler.cpp | 4 ++-- gui/threadhandler.h | 6 +++--- gui/threadresult.cpp | 2 +- gui/threadresult.h | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gui/checkthread.h b/gui/checkthread.h index 2cfa255c16f..e78f1580440 100644 --- a/gui/checkthread.h +++ b/gui/checkthread.h @@ -49,7 +49,6 @@ class ThreadResult; */ class CheckThread : public QThread { Q_OBJECT - public: struct Details { int threadIndex; @@ -111,8 +110,8 @@ class CheckThread : public QThread { */ void done(); - void startCheck(const CheckThread::Details& details); - void finishCheck(const CheckThread::Details& details); + void startCheck(CheckThread::Details details); + void finishCheck(CheckThread::Details details); protected: /** @@ -160,5 +159,6 @@ class CheckThread : public QThread { QStringList mClangIncludePaths; QList mSuppressionsUi; }; +Q_DECLARE_METATYPE(CheckThread::Details); /// @} #endif // CHECKTHREAD_H diff --git a/gui/threaddetails.cpp b/gui/threaddetails.cpp index 16ac72fea67..5b46ad90344 100644 --- a/gui/threaddetails.cpp +++ b/gui/threaddetails.cpp @@ -22,7 +22,7 @@ ThreadDetails::~ThreadDetails() delete mUi; } -void ThreadDetails::threadDetailsUpdated(const QMap& threadDetails) +void ThreadDetails::threadDetailsUpdated(QMap threadDetails) { QMutexLocker locker(&mMutex); mThreadDetails = threadDetails; @@ -31,7 +31,7 @@ void ThreadDetails::threadDetailsUpdated(const QMap& } } -void ThreadDetails::progress(const QString &filename, const QString& stage, const std::size_t value) { +void ThreadDetails::progress(QString filename, QString stage, const std::size_t value) { QMutexLocker locker(&mMutex); mProgress[filename] = {QString(), stage + QString(value > 0 ? ": %1%" : "").arg(value)}; } diff --git a/gui/threaddetails.h b/gui/threaddetails.h index d97ef669fc9..e6a5e70ab95 100644 --- a/gui/threaddetails.h +++ b/gui/threaddetails.h @@ -24,8 +24,8 @@ class ThreadDetails : public QWidget } public slots: - void threadDetailsUpdated(const QMap& threadDetails); - void progress(const QString &filename, const QString& stage, const std::size_t value); + void threadDetailsUpdated(QMap threadDetails); + void progress(QString filename, QString stage, const std::size_t value); private slots: void updateUI(); diff --git a/gui/threadhandler.cpp b/gui/threadhandler.cpp index 787ae6179bc..3b5552bf686 100644 --- a/gui/threadhandler.cpp +++ b/gui/threadhandler.cpp @@ -331,14 +331,14 @@ void ThreadHandler::setCheckStartTime(QDateTime checkStartTime) // cppcheck-suppress passedByValueCallback // NOLINTNEXTLINE(performance-unnecessary-value-param) -void ThreadHandler::startCheck(const CheckThread::Details& details) +void ThreadHandler::startCheck(CheckThread::Details details) { mThreadDetails[details.threadIndex] = details; emitThreadDetailsUpdated(); } // NOLINTNEXTLINE(performance-unnecessary-value-param) -void ThreadHandler::finishCheck(const CheckThread::Details& details) +void ThreadHandler::finishCheck(CheckThread::Details details) { mThreadDetails.remove(details.threadIndex); emitThreadDetailsUpdated(); diff --git a/gui/threadhandler.h b/gui/threadhandler.h index 1f9faecd853..158c27444c0 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -213,16 +213,16 @@ public slots: * @brief Slot threads use to signal this class that it started checking a file * @param details Details about what file is being checked and by what thread */ - void startCheck(const CheckThread::Details& details); + void startCheck(CheckThread::Details details); /** * @brief Slot threads use to signal this class that it finish checking a file * @param details Details about what file finished being checked and by what thread */ - void finishCheck(const CheckThread::Details& details); + void finishCheck(CheckThread::Details details); signals: - void progress(const QString &filename, const QString& stage, const std::size_t value); + void progress(QString filename, QString stage, const std::size_t value); protected slots: /** diff --git a/gui/threadresult.cpp b/gui/threadresult.cpp index 999177c49f7..a01def23e27 100644 --- a/gui/threadresult.cpp +++ b/gui/threadresult.cpp @@ -35,7 +35,7 @@ void ThreadResult::reportOut(const std::string &outmsg, Color /*c*/) } // NOLINTNEXTLINE(performance-unnecessary-value-param) -void ThreadResult::finishCheck(const CheckThread::Details& details) +void ThreadResult::finishCheck(CheckThread::Details details) { std::lock_guard locker(mutex); diff --git a/gui/threadresult.h b/gui/threadresult.h index 52f6cfefffe..ca433bfd4a0 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -92,7 +92,7 @@ public slots: * @brief Slot threads use to signal this class that it finish checking a file * @param details Details about what file finished being checked and by what thread */ - void finishCheck(const CheckThread::Details& details); + void finishCheck(CheckThread::Details details); signals: /** @@ -127,7 +127,7 @@ public slots: // NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) - caused by generated MOC code void debugError(const ErrorItem &item); - void progress(const QString &filename, const QString& stage, const std::size_t value); + void progress(QString filename, QString stage, const std::size_t value); protected: From bf3632cab532db4ba1154a05433556b0228d014f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 15 Feb 2026 13:07:12 +0100 Subject: [PATCH 07/13] undefined reference --- gui/test/resultstree/testresultstree.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gui/test/resultstree/testresultstree.cpp b/gui/test/resultstree/testresultstree.cpp index 3b3949539e3..afda38e0075 100644 --- a/gui/test/resultstree/testresultstree.cpp +++ b/gui/test/resultstree/testresultstree.cpp @@ -124,6 +124,9 @@ void ThreadResult::reportOut(const std::string & /*unused*/, Color /*unused*/) { void ThreadResult::reportErr(const ErrorMessage & /*unused*/) { throw 1; } +void ThreadResult::reportProgress(const std::string &/*filename*/, const char /*stage*/[], const std::size_t /*value*/) { + throw 1; +} // Test... From 3e53f43cf1fc6ee9160bef168995904b0233e01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 15 Feb 2026 13:15:48 +0100 Subject: [PATCH 08/13] clang-tidy --- gui/threaddetails.cpp | 2 +- gui/threaddetails.h | 2 +- gui/threadhandler.h | 2 +- gui/threadresult.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gui/threaddetails.cpp b/gui/threaddetails.cpp index 5b46ad90344..d825996a69c 100644 --- a/gui/threaddetails.cpp +++ b/gui/threaddetails.cpp @@ -31,7 +31,7 @@ void ThreadDetails::threadDetailsUpdated(QMap threadD } } -void ThreadDetails::progress(QString filename, QString stage, const std::size_t value) { +void ThreadDetails::progress(QString filename, QString stage, std::size_t value) { QMutexLocker locker(&mMutex); mProgress[filename] = {QString(), stage + QString(value > 0 ? ": %1%" : "").arg(value)}; } diff --git a/gui/threaddetails.h b/gui/threaddetails.h index e6a5e70ab95..253b53d5407 100644 --- a/gui/threaddetails.h +++ b/gui/threaddetails.h @@ -25,7 +25,7 @@ class ThreadDetails : public QWidget public slots: void threadDetailsUpdated(QMap threadDetails); - void progress(QString filename, QString stage, const std::size_t value); + void progress(QString filename, QString stage, std::size_t value); private slots: void updateUI(); diff --git a/gui/threadhandler.h b/gui/threadhandler.h index 158c27444c0..9f3d01f17e6 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -222,7 +222,7 @@ public slots: void finishCheck(CheckThread::Details details); signals: - void progress(QString filename, QString stage, const std::size_t value); + void progress(QString filename, QString stage, std::size_t value); protected slots: /** diff --git a/gui/threadresult.h b/gui/threadresult.h index ca433bfd4a0..1eeb2ab9f8d 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -84,7 +84,7 @@ class ThreadResult : public QObject, public ErrorLogger { { (void) metric; } - void reportProgress(const std::string &filename, const char stage[], const std::size_t value) override; + void reportProgress(const std::string &filename, const char stage[], std::size_t value) final; public slots: @@ -127,7 +127,7 @@ public slots: // NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) - caused by generated MOC code void debugError(const ErrorItem &item); - void progress(QString filename, QString stage, const std::size_t value); + void progress(QString filename, QString stage, std::size_t value); protected: From 656fcd0ae5154e5b1d3f04cec0bcacf877c3de1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 19 Feb 2026 13:50:28 +0100 Subject: [PATCH 09/13] clang-tidy suppressions --- gui/threaddetails.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gui/threaddetails.cpp b/gui/threaddetails.cpp index d825996a69c..949ea572000 100644 --- a/gui/threaddetails.cpp +++ b/gui/threaddetails.cpp @@ -22,6 +22,7 @@ ThreadDetails::~ThreadDetails() delete mUi; } +// NOLINTNEXTLINE(performance-unnecessary-value-param) - false positive void ThreadDetails::threadDetailsUpdated(QMap threadDetails) { QMutexLocker locker(&mMutex); @@ -31,6 +32,7 @@ void ThreadDetails::threadDetailsUpdated(QMap threadD } } +// NOLINTNEXTLINE(performance-unnecessary-value-param) - false positive void ThreadDetails::progress(QString filename, QString stage, std::size_t value) { QMutexLocker locker(&mMutex); mProgress[filename] = {QString(), stage + QString(value > 0 ? ": %1%" : "").arg(value)}; From 5adc0a4dc8f2465e4664b563af8ab888328ed6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 19 Feb 2026 13:58:54 +0100 Subject: [PATCH 10/13] const --- gui/threadresult.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/threadresult.h b/gui/threadresult.h index 1eeb2ab9f8d..3a5776d6d1d 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -84,7 +84,7 @@ class ThreadResult : public QObject, public ErrorLogger { { (void) metric; } - void reportProgress(const std::string &filename, const char stage[], std::size_t value) final; + void reportProgress(const std::string &filename, const char stage[], const std::size_t value) final; public slots: From 32ff2b24849789eb4165b6f4571dea464836732f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 19 Feb 2026 15:13:50 +0100 Subject: [PATCH 11/13] clang-tidy --- gui/threadresult.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/threadresult.cpp b/gui/threadresult.cpp index a01def23e27..f3a7e67ab16 100644 --- a/gui/threadresult.cpp +++ b/gui/threadresult.cpp @@ -60,6 +60,7 @@ void ThreadResult::reportErr(const ErrorMessage &msg) emit debugError(item); } +// NOLINTNEXTLINE(readability-avoid-const-params-in-decls) - false positive this is an overload void ThreadResult::reportProgress(const std::string &filename, const char stage[], const std::size_t value) { emit progress(QString::fromStdString(filename), stage, value); } From 46c18663628c8b3034d2587b36a0ae1423305e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 19 Feb 2026 16:08:53 +0100 Subject: [PATCH 12/13] ci --- gui/threaddetails.cpp | 8 ++++---- gui/threadresult.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gui/threaddetails.cpp b/gui/threaddetails.cpp index 949ea572000..66f604078f5 100644 --- a/gui/threaddetails.cpp +++ b/gui/threaddetails.cpp @@ -43,10 +43,10 @@ void ThreadDetails::updateUI() { { QMutexLocker locker(&mMutex); for (const auto& td: mThreadDetails) { - auto& progress = mProgress[td.file]; - if (progress.first.isEmpty() && !progress.second.isEmpty()) - progress.first = QTime::currentTime().toString(Qt::TextDate); - text += QString("%1\t%2\t%3\n\t%4\t%5\n").arg(td.threadIndex).arg(td.startTime.toString(Qt::TextDate)).arg(td.file).arg(progress.first).arg(progress.second); + auto& timeProgress = mProgress[td.file]; + if (timeProgress.first.isEmpty() && !timeProgress.second.isEmpty()) + timeProgress.first = QTime::currentTime().toString(Qt::TextDate); + text += QString("%1\t%2\t%3\n\t%4\t%5\n").arg(td.threadIndex).arg(td.startTime.toString(Qt::TextDate)).arg(td.file).arg(timeProgress.first).arg(timeProgress.second); } } mUi->plainTextEdit->setPlainText(text); diff --git a/gui/threadresult.h b/gui/threadresult.h index 3a5776d6d1d..b7bece3e28c 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -84,6 +84,7 @@ class ThreadResult : public QObject, public ErrorLogger { { (void) metric; } + // NOLINTNEXTLINE(readability-avoid-const-params-in-decls) - false positive this is an overload void reportProgress(const std::string &filename, const char stage[], const std::size_t value) final; public slots: From c6e10f46bdec5d27340b28aec3169ea99dc28b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 19 Feb 2026 17:53:56 +0100 Subject: [PATCH 13/13] ci --- gui/threaddetails.cpp | 1 + gui/threadhandler.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/gui/threaddetails.cpp b/gui/threaddetails.cpp index 66f604078f5..9036c18305d 100644 --- a/gui/threaddetails.cpp +++ b/gui/threaddetails.cpp @@ -32,6 +32,7 @@ void ThreadDetails::threadDetailsUpdated(QMap threadD } } +// cppcheck-suppress passedByValue // NOLINTNEXTLINE(performance-unnecessary-value-param) - false positive void ThreadDetails::progress(QString filename, QString stage, std::size_t value) { QMutexLocker locker(&mMutex); diff --git a/gui/threadhandler.cpp b/gui/threadhandler.cpp index 3b5552bf686..55f60de673d 100644 --- a/gui/threadhandler.cpp +++ b/gui/threadhandler.cpp @@ -337,6 +337,7 @@ void ThreadHandler::startCheck(CheckThread::Details details) emitThreadDetailsUpdated(); } +// cppcheck-suppress passedByValueCallback // NOLINTNEXTLINE(performance-unnecessary-value-param) void ThreadHandler::finishCheck(CheckThread::Details details) {