[utilities/kdebugsettings] src/core/model: Minor optimization

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 25f50018b885d2534ac7b5991fbe22045e6e1084 by Laurent Montel.
Committed on 30/07/2026 at 21:34.
Pushed by mlaurent into branch 'master'.

Minor optimization

M  +1    -1    src/core/model/kdeapplicationloggingcategorymodel.cpp

https://invent.kde.org/utilities/kdebugsettings/-/commit/25f50018b885d2534ac7b5991fbe22045e6e1084

diff --git a/src/core/model/kdeapplicationloggingcategorymodel.cpp b/src/core/model/kdeapplicationloggingcategorymodel.cpp
index cc8d895b..95ff81a4 100644
--- a/src/core/model/kdeapplicationloggingcategorymodel.cpp
+++ b/src/core/model/kdeapplicationloggingcategorymodel.cpp
@@ -90,9 +90,9 @@ bool KDEApplicationLoggingCategoryModel::setData(const QModelIndex &modelIndex,
         qCWarning(KDEBUGSETTINGSCORE_LOG) << "ERROR: out-of-range index" << idx;
         return false;
     }
-    LoggingCategory &cat = mLoggingCategories[idx];
     switch (static_cast<CategoryRoles>(modelIndex.column())) {
     case LoggingTypeRole: {
+        LoggingCategory &cat = mLoggingCategories[idx];
         cat.loggingType = value.value<LoggingCategory::LoggingType>();
         const QModelIndex topLeft = index(modelIndex.row(), LoggingTypeRole);
         const QModelIndex bottomRight = index(modelIndex.row(), LoggingTypeStrRole);
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.