diff options
author | Thomas Hartmann <[email protected]> | 2024-05-13 15:08:25 +0200 |
---|---|---|
committer | Thomas Hartmann <[email protected]> | 2024-05-14 11:30:28 +0000 |
commit | 22657af3f0d1df073c1a697d59f45dc3e2bf3c0a (patch) | |
tree | 21d7ae1ec730ade165d1fcf8612c892e934b985a /src/libs/qmlpuppetcommunication | |
parent | 7ffd4805ca739c1ebe5159512b8eb8998443aaed (diff) |
QmlDesigner: Use reverse iterators to support qualified scopes
Change-Id: I88a4dcbff7a50f399b81a948f273e9cf9e36782d
Reviewed-by: Marco Bubke <[email protected]>
Diffstat (limited to 'src/libs/qmlpuppetcommunication')
-rw-r--r-- | src/libs/qmlpuppetcommunication/types/enumeration.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libs/qmlpuppetcommunication/types/enumeration.h b/src/libs/qmlpuppetcommunication/types/enumeration.h index 57bfe6c0ef4..5fe2294621e 100644 --- a/src/libs/qmlpuppetcommunication/types/enumeration.h +++ b/src/libs/qmlpuppetcommunication/types/enumeration.h @@ -43,17 +43,20 @@ public: EnumerationNameView scope() const { - auto found = std::find(m_enumerationName.begin(), m_enumerationName.end(), '.'); - return {m_enumerationName.begin(), found}; + auto found = std::find(m_enumerationName.rbegin(), m_enumerationName.rend(), '.'); + if (found != m_enumerationName.rend()) + return {m_enumerationName.begin(), std::prev(found.base())}; + + return {m_enumerationName.end(), m_enumerationName.end()}; } EnumerationNameView toScope() const { return scope().toByteArray(); } EnumerationNameView name() const { - auto found = std::find(m_enumerationName.begin(), m_enumerationName.end(), '.'); - if (found != m_enumerationName.end()) - return {std::next(found), m_enumerationName.end()}; + auto found = std::find(m_enumerationName.rbegin(), m_enumerationName.rend(), '.'); + if (found != m_enumerationName.rend()) + return {found.base(), m_enumerationName.end()}; return {m_enumerationName.end(), m_enumerationName.end()}; } |