forked from qt-creator/qt-creator
McuSupport: Prevent multiple packages writing to the same key
Writing with an empty settings key will result in multiple packages writing their value in the same key "Package_", with the suffix missing, overwriting each other. Change-Id: Iee3e042a2d9d5d1f4e34b903360129ba25b6f6ea Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Yasser Grimes <yasser.grimes@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
committed by
Rainer Keller
parent
42481ced35
commit
6493f2793f
@@ -221,6 +221,12 @@ QString McuPackage::statusText() const
|
|||||||
|
|
||||||
bool McuPackage::writeToSettings() const
|
bool McuPackage::writeToSettings() const
|
||||||
{
|
{
|
||||||
|
if (m_settingsKey.isEmpty()) {
|
||||||
|
// Writing with an empty settings key will result in multiple packages writing their value
|
||||||
|
// in the same key "Package_", with the suffix missing, overwriting each other.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return settingsHandler->write(m_settingsKey, m_path, m_defaultPath);
|
return settingsHandler->write(m_settingsKey, m_path, m_defaultPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user