[kdevelop/kdevelop] kdevplatform/language/duchain/navigation: Do not show redundant virtual detail for final and abstract

Yin Zhijie <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit fdef9ba5e145f02194d400f0eba65eef0ba1758d by Yin Zhijie.
Committed on 27/07/2026 at 10:12.
Pushed by bednar into branch 'master'.

Do not show redundant virtual detail for final and abstract

M  +5    -1    kdevplatform/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp

https://invent.kde.org/kdevelop/kdevelop/-/commit/fdef9ba5e145f02194d400f0eba65eef0ba1758d

diff --git a/kdevplatform/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp b/kdevplatform/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp
index f3124bbef5..a680df9403 100644
--- a/kdevplatform/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp
+++ b/kdevplatform/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp
@@ -837,9 +837,13 @@ QStringList AbstractDeclarationNavigationContext::declarationDetails(const Decla
 
         const auto* classFunDecl = dynamic_cast<const ClassFunctionDeclaration*>(decl.data());
         if (classFunDecl) {
+            const bool isVirtual = classFunDecl->isVirtual();
+            const bool isAbstract = classFunDecl->isAbstract();
+            const bool isFinal = classFunDecl->isFinal();
             if (classFunDecl->isExplicit())
                 details << QStringLiteral("explicit");
-            if (classFunDecl->isVirtual())
+            // "abstract" and "final" already imply virtual.
+            if (isVirtual && !isAbstract && !isFinal)
                 details << QStringLiteral("virtual");
             if (classFunDecl->isSignal())
                 details << QStringLiteral("signal");
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.