fix: 修复显示桌面和多任务视图不能在任务栏上移除驻留

保存配置信息判断条件不完善,导致移除功能失效

Log: 修复显示桌面和多任务视图不能在任务栏上移除驻留
Bug: https://pms.uniontech.com/zentao/bug-view-83630.html
Change-Id: Icb4bacabaf0b2436aae5d84fda0c705e4a34e966
This commit is contained in:
yanghongwei 2021-06-15 14:02:44 +08:00
parent 805028949c
commit d319ba4ae8

View File

@ -84,11 +84,13 @@ void AbstractPluginsController::saveValue(PluginsItemInterface *const itemInter,
}
// 修改插件的order值位置为队尾
QString name = localObject.keys().last();
localObject.insert(name, QJsonValue::fromVariant(fixedPluginCount)); //Note: QVariant::toJsonValue() not work in Qt 5.7
// daemon中同样修改
remoteObjectInter.insert(name, QJsonValue::fromVariant(fixedPluginCount)); //Note: QVariant::toJsonValue() not work in Qt 5.7
remoteObject.insert(itemInter->pluginName(), remoteObjectInter);
// 此次做一下判断有可能初始数据不存在pos_*字段会导致enable字段被修改。或者此处可以循环所有字段是否存在pos_开头的字段
if (name != key) {
localObject.insert(name, QJsonValue::fromVariant(fixedPluginCount)); //Note: QVariant::toJsonValue() not work in Qt 5.7
// daemon中同样修改
remoteObjectInter.insert(name, QJsonValue::fromVariant(fixedPluginCount)); //Note: QVariant::toJsonValue() not work in Qt 5.7
remoteObject.insert(itemInter->pluginName(), remoteObjectInter);
}
}
m_pluginSettingsObject.insert(itemInter->pluginName(), localObject);