aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmlpuppetcommunication
diff options
context:
space:
mode:
authorThomas Hartmann <[email protected]>2024-05-13 15:08:25 +0200
committerThomas Hartmann <[email protected]>2024-05-14 11:30:28 +0000
commit22657af3f0d1df073c1a697d59f45dc3e2bf3c0a (patch)
tree21d7ae1ec730ade165d1fcf8612c892e934b985a /src/libs/qmlpuppetcommunication
parent7ffd4805ca739c1ebe5159512b8eb8998443aaed (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.h13
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()};
}