mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix: plugin settings value can not transform to Json value in qt 5.7
https://github.com/linuxdeepin/internal-discussion/issues/1312
This commit is contained in:
parent
7338d8fb83
commit
9293c45df5
@ -51,12 +51,12 @@ void AbstractPluginsController::saveValue(PluginsItemInterface *const itemInter,
|
||||
|
||||
// save to local cache
|
||||
QJsonObject localObject = m_pluginSettingsObject.value(itemInter->pluginName()).toObject();
|
||||
localObject.insert(key, value.toJsonValue());
|
||||
localObject.insert(key, QJsonValue::fromVariant(value)); //Note: QVariant::toJsonValue() not work in Qt 5.7
|
||||
m_pluginSettingsObject.insert(itemInter->pluginName(), localObject);
|
||||
|
||||
// save to daemon
|
||||
QJsonObject remoteObject, remoteObjectInter;
|
||||
remoteObjectInter.insert(key, value.toJsonValue());
|
||||
remoteObjectInter.insert(key, QJsonValue::fromVariant(value)); //Note: QVariant::toJsonValue() not work in Qt 5.7
|
||||
remoteObject.insert(itemInter->pluginName(), remoteObjectInter);
|
||||
m_dockDaemonInter->MergePluginSettings(QJsonDocument(remoteObject).toJson(QJsonDocument::JsonFormat::Compact));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user