scene: Re-order item list integrity checks

Amends 6738473f3d.

It's better to check whether Item::childItems() has the same items as
Item::sortedChildItems() first because it gives more context about the
integrity of the lists.

If Item::sortedChildItems() is corrupted but Item::childItems() is fine,
we may miss that important detail because
"aliveWindowItems != sortedWindowItems" comes first.
wilder/Plasma/6.3
Vlad Zahorodnii 1 year ago
parent 371879a9f9
commit 1df73874fc
  1. 6
      src/scene/workspacescene.cpp

@ -510,12 +510,12 @@ void WorkspaceScene::createStackingOrder()
}
std::sort(windowItems.begin(), windowItems.end());
if (aliveWindowItems != sortedWindowItems) {
qFatal("workspaceWindowItems != sortedWindowItems");
}
if (sortedWindowItems != windowItems) {
qFatal("sortedWindowItems != windowItems");
}
if (aliveWindowItems != sortedWindowItems) {
qFatal("workspaceWindowItems != sortedWindowItems");
}
}
for (Item *item : std::as_const(items)) {

Loading…
Cancel
Save