fix: 修复同步插件配置项时导致任务栏崩溃的问题

m_pluginsMap中同时保存了QPluginLoader和SystemTrayItem插件对象,在同步时会先移动后再再添加保存的插件对象,
但是QPluginLoader不是图标插件,会导致访问指针类型错误任务栏崩溃

Log: 修复账户同步后导致任务栏多次崩溃而进入安全模式问题
Bug: https://pms.uniontech.com/zentao/bug-view-104724.html
Influence: 账户同步后不会导致任务栏崩溃
Change-Id: Idbe9700b7c216903657db6d385b54647b640136d
This commit is contained in:
chenjun 2021-12-02 14:40:52 +08:00
parent 5faf079c22
commit 836bb57d1c

View File

@ -353,10 +353,14 @@ void AbstractPluginsController::refreshPluginSettings()
for (auto it = pluginsMapTemp.constBegin(); it != pluginsMapTemp.constEnd(); ++it) {
const QList<QString> &itemKeyList = it.value().keys();
for (auto key : itemKeyList) {
itemRemoved(it.key(), key);
if (key != "pluginloader") {
itemRemoved(it.key(), key);
}
}
for (auto key : itemKeyList) {
itemAdded(it.key(), key);
if (key != "pluginloader") {
itemAdded(it.key(), key);
}
}
}
}