diff --git a/src/plugins/coreplugin/helpitem.cpp b/src/plugins/coreplugin/helpitem.cpp index a5025b1b6e6..66e6d7a50bf 100644 --- a/src/plugins/coreplugin/helpitem.cpp +++ b/src/plugins/coreplugin/helpitem.cpp @@ -144,7 +144,7 @@ QString HelpItem::extractContent(bool extended) const QMap HelpItem::links() const { - if (m_helpLinks.isEmpty()) + if (!m_helpLinks) m_helpLinks = Core::HelpManager::linksForIdentifier(m_helpId); - return m_helpLinks; + return *m_helpLinks; } diff --git a/src/plugins/coreplugin/helpitem.h b/src/plugins/coreplugin/helpitem.h index 496e32ffe7d..bca8d1d2c7e 100644 --- a/src/plugins/coreplugin/helpitem.h +++ b/src/plugins/coreplugin/helpitem.h @@ -27,6 +27,8 @@ #include "core_global.h" +#include + #include #include #include @@ -77,7 +79,7 @@ private: QString m_helpId; QString m_docMark; Category m_category = Unknown; - mutable QMap m_helpLinks; // cached help links + mutable Utils::optional> m_helpLinks; // cached help links }; } // namespace Core