[graphics/digikam] core/libs/database/history: cppcheck++

Gilles Caulier <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 33574c880d30818cf6dde9ff488aaee3d9379e55 by Gilles Caulier.
Committed on 05/08/2026 at 06:00.
Pushed by cgilles into branch 'master'.

cppcheck++

M  +7    -5    core/libs/database/history/itemhistorygraphmodel.cpp

https://invent.kde.org/graphics/digikam/-/commit/33574c880d30818cf6dde9ff488aaee3d9379e55

diff --git a/core/libs/database/history/itemhistorygraphmodel.cpp b/core/libs/database/history/itemhistorygraphmodel.cpp
index ff67eb5b52..74d32b292d 100644
--- a/core/libs/database/history/itemhistorygraphmodel.cpp
+++ b/core/libs/database/history/itemhistorygraphmodel.cpp
@@ -316,6 +316,8 @@ public:
                                 : rootItem);
     }
 
+public:
+
     void build();
     void buildImagesList();
     void buildImagesTree();
@@ -799,7 +801,7 @@ QModelIndex ItemHistoryGraphModel::indexForInfo(const ItemInfo& info) const
     for (VertexItem* const item : std::as_const(d->vertexItems))
     {
         if (ItemModel::retrieveItemInfo(item->index) == info)
-        {    // cppcheck-suppress useStlAlgorithm
+        {   // cppcheck-suppress useStlAlgorithm
             return createIndex(item->parent->children.indexOf(item), 0, item);
         }
     }
@@ -986,7 +988,7 @@ QModelIndex ItemHistoryGraphModel::imageModelIndex(const QModelIndex& index) con
 {
     HistoryTreeItem* const item = d->historyItem(index);     // cppcheck-suppress constVariablePointer
 
-    if_isItem(VertexItem, vertexItem, item)      // cppcheck-suppress constVariablePointer
+    if_isItem(VertexItem, vertexItem, item)                  // cppcheck-suppress constVariablePointer
     {
         return vertexItem->index;
     }
@@ -1073,15 +1075,15 @@ bool ItemHistoryGraphModel::hasChildren(const QModelIndex& parent) const
 
 QModelIndex ItemHistoryGraphModel::parent(const QModelIndex& index) const
 {
-    HistoryTreeItem* const item   = d->historyItem(index);
-    HistoryTreeItem* const parent = item->parent;
+    HistoryTreeItem* const item              = d->historyItem(index);
+    HistoryTreeItem* const parent            = item->parent;
 
     if (!parent)
     {
         return QModelIndex();    // Index was an invalid index.
     }
 
-    HistoryTreeItem* const grandparent = parent->parent;
+    const HistoryTreeItem* const grandparent = parent->parent;
 
     if (!grandparent)
     {
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.