Quantcast
Channel: PowerDevil activity
Viewing all articles
Browse latest Browse all 2193

Jakob Petsovits commented on merge request !318 at Plasma / PowerDevil

$
0
0

I think this can be simplified. You already have a check for m_displayIds.contains(path) further down, and another m_displayIds.indexOf(path) as well. disconnect() won't be necessary if the display object is deleted, which is what happens when you erase(path) it. So all that's left is:

  1. For the remove/erase block, put if (auto index = m_displayIds.indexOf(path); index != -1) instead of if (m_displayIds.contains(path))
  2. After remove/erase statements, add the extra block containing the connect() statement with a combined condition if (index == 0 && !m_displayIds.Empty()).

Viewing all articles
Browse latest Browse all 2193

Trending Articles