Skip to content
  • Thomas Haller's avatar
    libnm: move sorting of settings out of nm_setting_enumerate_values() and cache it · 7cc24629
    Thomas Haller authored
    The property infos are already sorted by name. As nm_setting_enumerate_values()
    now uses that information, in most cases there is nothing to sort.
    
    The only instance is NMSettingConnection, which has a different
    sort-order. At least for some purposes, not all:
    
      - nm_setting_enumerate_values(), obviously.
    
      - nm_setting_enumerate_values() is called by keyfile writer. That
        means, keyfile writer will persist properties in a sorted way.
    
    Cache the property list with alternative sorting also in the
    setting-meta data, instead of calculating it each time.
    
    Beside caching the information, this has the additional benefit that
    this kind of sorting is now directly available, without calling
    nm_setting_enumerate_values(). Meaning, we can implement keyfile writer
    without using nm_setting_enumerate_values().
    7cc24629