From 22550bbc0566f6b6e1c9719f324988d296733e04 Mon Sep 17 00:00:00 2001 From: Sune Vuorela Date: Sat, 5 Aug 2023 08:25:36 +0000 Subject: [PATCH] Improve cppcheck configuration - Ignore autotests sources - Teach cppcheck about a okular specific define - Keep the default options from the KDE setup This at least for me brings the cppcheck entries from "unusable" to "something that probably should be looked into" --- .kde-ci.yml | 5 +++++ shell/welcomescreen.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.kde-ci.yml b/.kde-ci.yml index f196a043c..19dcfb4cc 100644 --- a/.kde-ci.yml +++ b/.kde-ci.yml @@ -27,3 +27,8 @@ Dependencies: - 'on': ['Android'] 'require': 'frameworks/kirigami': '@stable' + +Options: + cppcheck-arguments: '--enable=warning,style,performance -DOKULAR_EXPORT_PLUGIN' + cppcheck-ignore-files: + - autotests diff --git a/shell/welcomescreen.cpp b/shell/welcomescreen.cpp index 1e4bff15e..3ba676687 100644 --- a/shell/welcomescreen.cpp +++ b/shell/welcomescreen.cpp @@ -41,10 +41,10 @@ public: const RecentItemsModel *model = static_cast(aModel); const RecentItemsModel::RecentItem *item = model->getItem(index); - bool willOpenMenu = false; QPoint menuPosition; if (item != nullptr) { + bool willOpenMenu = false; if (event->type() == QEvent::ContextMenu) { willOpenMenu = true; menuPosition = static_cast(event)->globalPos();