Fuchs added a comment.

  On the existing bug: it's related to the TODO, changing that to
  
    for (int i = 0; i < d->concatProxyModel->rowCount(); ++i) {
        const QModelIndex &itIndex = d->concatProxyModel->index(i, 0);
    
        // Launchers can't be pinned / unpinned
        if (itIndex.data(AbstractTasksModel::IsLauncher).toBool()) {
            continue;
        }
        
        dataChanged(itIndex, itIndex, 
QVector<int>{AbstractTasksModel::IsPinned});
        
    }
  
  fixes the bug, but of course that goes through all items and not only the 
needed ones, so it's bad performance-wise.
  
                
  
  Oddly enough, changing the second part to
  
    // Check all windows if they match, then update the isPinned for them too. 
    // This is needed so if you pin / unpin an app that has multiple instances 
open, all are updated.
    if (appsMatch(index, itIndex)) {
        dataChanged(itIndex, itIndex, 
QVector<int>{AbstractTasksModel::IsPinned});
    }
  
  matched only parts of the same window, so if I e.g. had 3 konsole instances 
open, it affected 2/3 sometimes.
  
  No idea what I am doing wrong here, hopefully @hein  will know what list I 
best iterate over and how to best compare them, so it's not only fixed, but 
fixed without performance impact.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D12462

To: Fuchs, hein
Cc: plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart

Reply via email to