Commits

Frerich Raabe committed 85883d043b4
Allow calling installer.setValue() with an empty string as the value Calls like installer.setValue("RunProgram", ""); would fail if there was no previous setValue() call which set the variable to a non-empty string. In PackageManagerCoreData, the variables of the installer which are accessible via installer.setValue and installer.value are managed in two data structures: * m_variables contains all variables which were set at runtime, via installer.setValue * m_settings contains all variables as defined in the XML configuration file. When calling installer.value(), it would first consider m_variables and if the given variable name is not in that structure, it falls back to m_settings. What happened for calls like 'installer.setValue("RunProgram", "");' was that the code tries to detect whether the variable already has the specified value -- and only if it doesn't, the variable is set. To test if the variable has the specified value, it would simply check m_variables.value(key) and compare it with the given new value. However, if the key was never set, 'value()' returns an empty string -- which is equal to the new value, and hence PackageManagerCoreData::setValue() returned false. Fix this by first verifying that the given key exists in the m_variables object at all before bothering to check what m_variables.value() returns. Change-Id: I8a2bcb74e52e05f1454945628bcf372445c91a17 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>