From 5790816a5a39bdad02926d5f27275513345ad2eb Mon Sep 17 00:00:00 2001 From: tsic404 Date: Thu, 25 Jan 2024 13:56:26 +0800 Subject: [PATCH] fix: dock not remove plugin when fcitx exit rowCountChanged signal not send log: send rowCountChanged signal issue: https://github.com/linuxdeepin/developer-center/issues/7080 --- frame/window/tray/tray_model.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/frame/window/tray/tray_model.cpp b/frame/window/tray/tray_model.cpp index 7050958bf..3200f8116 100644 --- a/frame/window/tray/tray_model.cpp +++ b/frame/window/tray/tray_model.cpp @@ -575,15 +575,13 @@ void TrayModel::onSniTrayRemoved(const QString &servicePath) // 如果为输入法,则无需立刻删除,等100毫秒后再观察是否会删除输入法(因为在100毫秒内如果是切换输入法,就会很快发送add信号) if (info.isTypeWriting) { - QTimer::singleShot(100, this, [ servicePath, this ] { - for (WinInfo info : m_winInfos) { - if (info.servicePath == servicePath) { - int index = m_winInfos.indexOf(info); - beginRemoveRows(QModelIndex(), index, index); - m_winInfos.removeOne(info); - endRemoveRows(); - } - } + QTimer::singleShot(100, this, [ info, this ] { + int index = m_winInfos.indexOf(info); + beginRemoveRows(QModelIndex(), index, index); + m_winInfos.removeOne(info); + endRemoveRows(); + + Q_EMIT rowCountChanged(); }); } else { beginRemoveRows(QModelIndex(), index, index);