Skip to content
  • Christian Kandeler's avatar
    ProjectExplorer: Make fromMap() public in BuildConfiguration. · 5977b6db
    Christian Kandeler authored
    
    
    And also in DeployConfiguration.
    
    Rationale: Consider this typical use case of a deploy configuration
    factory that can create several deploy configurations for a specific
    target.
    ProjectExplorer::DeployConfiguration *MyFactory::restore(map)
    {
        ProjectExplorer::DeployConfiguration *dc = 0;
        id = idFromMap(map)
        if (id == myDcId_1())
            dc = new MyDcId_1;
        else if (id == myDcId_2())
            dc = new MyDcId_2;
        ...
        else if (id == myDcId_n())
            dc = new MyDcId_n;
        if (dc)
            dc->fromMap(map);
        return dc;
    }
    This does currently not compile, forcing us to introduce n variables and
    calling fromMap() n times. In addition, we either have to make the
    factory a friend of all the deploy configurations or add a public
    fromMap() function into all of them, even if they don't add any
    functionality, or introduce some other type of silly boiler-plate code.
    All of this becomes unnecessary when fromMap() is public in the parent class.
    
    Note also that fromMap() is public in the inheritance root
    (ProjectConfiguration) as well as in RunConfiguration.
    
    Change-Id: I4c6431bba2500e2434c487c316e30ddb259fa2b5
    Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
    5977b6db