[pve-devel] [PATCH] ext5migrate: handle the case when a component's data is in the config object

Emmanuel Kasper e.kasper at proxmox.com
Mon Aug 3 16:37:58 CEST 2015


On 08/03/2015 04:22 PM, Dietmar Maurer wrote:
>> the data property is not available via me.data, but via me.config.data.
>> So we need to handle this in the parent class.
> 
> So why do we need both cases?
> 
> +           data : me.data || me.config.data
> 
> Isn't it enough to do:
> 
> +           data : me.config.data
> 


The thing is that there are many subclasses  from PVE.form.KVComboBox
who want to set me.data directly.

For instance there is in VNCKeyboardSelector.js:

Ext.define('PVE.form.VNCKeyboardSelector', {
    extend: 'PVE.form.KVComboBox',

    initComponent: function() {
	var me = this;
	me.data = PVE.Utils.kvm_keymap_array();
	me.callParent();
    }
});

I was trying to make the diff as small as possible (hence the change in
the parent class)

Should I change the subclasses instead ?

Emmanuel




More information about the pve-devel mailing list