MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / activeGroupIndex

Method activeGroupIndex

app/src/UI/Taskbar.cpp:164–180  ·  view source on GitHub ↗

* @brief Returns the workspace-model index of the active group, or -1 when none matches. */

Source from the content-addressed store, hash-verified

162 * @brief Returns the workspace-model index of the active group, or -1 when none matches.
163 */
164int UI::Taskbar::activeGroupIndex() const
165{
166 const auto model = workspaceModel();
167 int index = 0;
168 for (auto it = model.begin(); it != model.end(); ++it) {
169 const auto map = it->toMap();
170 if (!map.contains(QStringLiteral("id")))
171 continue;
172
173 if (map.value(QStringLiteral("id")).toInt() == m_activeGroupId)
174 return index;
175
176 ++index;
177 }
178
179 return -1;
180}
181
182/**
183 * @brief Returns whether this taskbar tracks its own workspace independently of the project.

Callers 1

getStatusMethod · 0.80

Calls 3

beginMethod · 0.80
containsMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected