[pim/libkleo] src: cppcheck: Silence more uninitMemberVarNoCtor warnings

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit da35f591027e323017d76bf9de8c6f987c156f09 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 30/07/2026 at 12:18.
Pushed by kloecker into branch 'master'.

cppcheck: Silence more uninitMemberVarNoCtor warnings

None of these warnings pointed to a problem because in all cases the
structs are always properly initialized.

M  +4    -2    src/kleo/kconfigbasedkeyfilter.cpp
M  +1    -1    src/kleo/keyresolvercore.h
M  +3    -3    src/ui/dnattributeorderconfigwidget.cpp

https://invent.kde.org/pim/libkleo/-/commit/da35f591027e323017d76bf9de8c6f987c156f09

diff --git a/src/kleo/kconfigbasedkeyfilter.cpp b/src/kleo/kconfigbasedkeyfilter.cpp
index 57c4f82a..e8d99d06 100644
--- a/src/kleo/kconfigbasedkeyfilter.cpp
+++ b/src/kleo/kconfigbasedkeyfilter.cpp
@@ -29,14 +29,16 @@ using namespace GpgME;
 //
 //
 struct KeyFilter::FontDescription::Private {
-    bool bold, italic, strikeOut, fullFont;
+    bool bold = false;
+    bool italic = false;
+    bool strikeOut = false;
+    bool fullFont = false;
     QFont font;
 };
 
 KeyFilter::FontDescription::FontDescription()
     : d(new Private)
 {
-    d->bold = d->italic = d->strikeOut = d->fullFont = false;
 }
 
 KeyFilter::FontDescription::FontDescription(const FontDescription &other)
diff --git a/src/kleo/keyresolvercore.h b/src/kleo/keyresolvercore.h
index 76602a53..780039c1 100644
--- a/src/kleo/keyresolvercore.h
+++ b/src/kleo/keyresolvercore.h
@@ -50,7 +50,7 @@ public:
         // clang-format on
     };
     struct Result {
-        SolutionFlags flags;
+        SolutionFlags flags = AllResolved;
         KeyResolver::Solution solution;
         KeyResolver::Solution alternative;
     };
diff --git a/src/ui/dnattributeorderconfigwidget.cpp b/src/ui/dnattributeorderconfigwidget.cpp
index 7ada803c..7d046f27 100644
--- a/src/ui/dnattributeorderconfigwidget.cpp
+++ b/src/ui/dnattributeorderconfigwidget.cpp
@@ -108,11 +108,11 @@ Kleo::DNAttributeOrderConfigWidget::DNAttributeOrderConfigWidget(QWidget *parent
     d->placeHolderItem->setData(0, Qt::AccessibleTextRole, i18n("All others"));
 
     struct NavButtonInfo {
-        const char *icon;
+        const char *icon = nullptr;
         const KLazyLocalizedString accessibleName;
         const KLazyLocalizedString tooltip;
-        void (DNAttributeOrderConfigWidget::*slot)();
-        bool autorepeat;
+        void (DNAttributeOrderConfigWidget::*slot)() = nullptr;
+        bool autorepeat = false;
     };
     static const std::vector<NavButtonInfo> navButtons = {
         {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.