• Skip to sidebar navigation
  • Skip to content
Linked Applications
Loading…

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Redkit
  1. Redkit

QtIFW

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks

Commits

Frerich Raabe
f80dfd7ea47
Download this commit
Frerich Raabe committed 85883d043b422 янв 2016
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>
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.8.0
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian
»

Everything looks good. We'll let you know here if there's anything you should know about.