Commit acebd8c8 authored by David Edmundson's avatar David Edmundson

[containmentactions/switchwindow] Fix loop itteration

Summary: BUG: 402552

Test Plan:
Opened menu
Didn't crash

Reviewers: #plasma, ngraham

Reviewed By: ngraham

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D17925
parent 87aa1884
...@@ -170,7 +170,7 @@ void SwitchWindow::makeMenu() ...@@ -170,7 +170,7 @@ void SwitchWindow::makeMenu()
const QStringList &desktopNames = m_virtualDesktopInfo->desktopNames(); const QStringList &desktopNames = m_virtualDesktopInfo->desktopNames();
if (m_mode == AllFlat) { if (m_mode == AllFlat) {
for (int i = 0; i <= desktopIds.count(); ++i) { for (int i = 0; i < desktopIds.count(); ++i) {
const QVariant &desktop = desktopIds.at(i); const QVariant &desktop = desktopIds.at(i);
if (desktops.contains(desktop)) { if (desktops.contains(desktop)) {
...@@ -189,7 +189,7 @@ void SwitchWindow::makeMenu() ...@@ -189,7 +189,7 @@ void SwitchWindow::makeMenu()
m_actions << allDesktops; m_actions << allDesktops;
} }
} else { // Submenus. } else { // Submenus.
for (int i = 0; i <= desktopIds.count(); ++i) { for (int i = 0; i < desktopIds.count(); ++i) {
const QVariant &desktop = desktopIds.at(i); const QVariant &desktop = desktopIds.at(i);
if (desktops.contains(desktop)) { if (desktops.contains(desktop)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment