File 0001-QDoc-Sort-non-function-nodes-by-name-then-erase-duplicates.patch of Package qt6-tools

From cc7a2141ff50d9826f13bb794d26479af0ab4492 Mon Sep 17 00:00:00 2001
From: David Boddie <david.boddie@qt.io>
Date: Wed, 14 May 2025 14:39:54 +0200
Subject: [PATCH] QDoc: Sort non-function nodes by name then erase duplicates

The order of node information in index files could change between runs
of QDoc. This appears to be due to the sorting method used before
erasing duplicate non-function nodes.

Task-number: QTBUG-136483
Change-Id: Ia58585c19e1c22172ee4c58c3ba054ec5d14a0d5
---

diff --git a/src/qdoc/qdoc/src/qdoc/aggregate.cpp b/src/qdoc/qdoc/src/qdoc/aggregate.cpp
index df4600d..4cdafc2 100644
--- a/src/qdoc/qdoc/src/qdoc/aggregate.cpp
+++ b/src/qdoc/qdoc/src/qdoc/aggregate.cpp
@@ -303,13 +303,11 @@
 const NodeList &Aggregate::nonfunctionList()
 {
     m_nonfunctionList = m_nonfunctionMap.values();
-    // Erase duplicates
-    std::sort(m_nonfunctionList.begin(), m_nonfunctionList.end());
-    m_nonfunctionList.erase(std::unique(m_nonfunctionList.begin(), m_nonfunctionList.end()),
-                            m_nonfunctionList.end());
-
     // Sort based on node name
     std::sort(m_nonfunctionList.begin(), m_nonfunctionList.end(), Node::nodeNameLessThan);
+    // Erase duplicates
+    m_nonfunctionList.erase(std::unique(m_nonfunctionList.begin(), m_nonfunctionList.end()),
+                            m_nonfunctionList.end());
     return m_nonfunctionList;
 }
 
openSUSE Build Service is sponsored by