improve qmultihash usage

wilder-5.22
Henri Chain 5 years ago committed by Eike Hein
parent 4700608e8a
commit 43568def0c
  1. 9
      libtaskmanager/xwindowtasksmodel.cpp

@ -333,7 +333,7 @@ void XWindowTasksModel::Private::transientChanged(WId window, NET::Properties pr
void XWindowTasksModel::Private::windowChanged(WId window, NET::Properties properties, NET::Properties2 properties2) void XWindowTasksModel::Private::windowChanged(WId window, NET::Properties properties, NET::Properties2 properties2)
{ {
if (transients.uniqueKeys().contains(window)) { if (transients.contains(window)) {
transientChanged(window, properties, properties2); transientChanged(window, properties, properties2);
return; return;
@ -648,9 +648,8 @@ QVariant XWindowTasksModel::data(const QModelIndex &index, int role) const
if (window == d->activeWindow) { if (window == d->activeWindow) {
return true; return true;
} }
const auto children = d->transients.values(window); for (const WId transient : d->transients.values(window)) {
for (int i = 0; i < children.size(); ++i) { if (transient == d->activeWindow) {
if (children.at(i) == d->activeWindow) {
return true; return true;
} }
} }
@ -746,7 +745,7 @@ void XWindowTasksModel::requestActivate(const QModelIndex &index)
// dialog and trying to bring the window forward by clicking on it in a tasks widget // dialog and trying to bring the window forward by clicking on it in a tasks widget
// TODO: do we need to check all the transients for shaded?" // TODO: do we need to check all the transients for shaded?"
} else if (!d->transients.isEmpty()) { } else if (!d->transients.isEmpty()) {
foreach (const WId transient, d->transients.values()) { foreach (const WId transient, d->transients) {
KWindowInfo info(transient, NET::WMState, NET::WM2TransientFor); KWindowInfo info(transient, NET::WMState, NET::WM2TransientFor);
if (info.valid(true) && info.hasState(NET::Shaded) && info.transientFor() == window) { if (info.valid(true) && info.hasState(NET::Shaded) && info.transientFor() == window) {

Loading…
Cancel
Save