pub trait KConfigTrait: KConfigImpl {
Show 14 methods fn is_dirty(&self) -> bool; fn is_config_writable(&self, warn_user: bool) -> bool; fn open_flags(&self) -> OpenFlags; fn reparse_configuration(&mut self); fn set_read_defaults(&mut self, b: bool); fn read_defaults(&self) -> bool; fn location_type(&self) -> QStandardPathLocation; fn set_main_config_name<T: Into<QString>>(name: T) { ... } fn name(&self) -> QString { ... } fn add_config_sources(&mut self, sources: QStringList) { ... } fn additional_config_sources(&self) -> QStringList { ... } fn locale(&self) -> QString { ... } fn set_locale<T>(&mut self, locale: T) -> bool
    where
        T: Into<QString>
, { ... } fn check_update<T>(&mut self, id: T, update_file: T)
    where
        T: Into<QString>
, { ... }
}
Expand description

Trait representing methods from KConfig class.

Required methods

Returns true if sync has any changes to write out.

Whether the configuration can be written to. The most likely cause for this method returning false is that the user does not have write permission for the configuration file.

Argumenst
  • warn_user - whether to show a warning message to the user if the configuration cannot be written to

Returns the flags this object was opened with.

Updates the state of this object to match the persistent storage. Note that if this object has pending changes, this method will call sync() first so as not to lose those changes.

When set, all readEntry calls return the system-wide (default) values instead of the user’s settings. This is off by default.

true if the system-wide defaults will be read instead of the user’s settings

Returns the standard location enum passed to the constructor.

Provided methods

Sets the name of the application config file.

Returns the filename used to store the configuration.

Adds the list of configuration sources to the merge stack. Currently only files are accepted as configuration sources. The first entry in sources is treated as the most general and will be overridden by the second entry. The settings in the final entry in sources will override all the other sources provided in the list. The state is automatically updated by this method, so there is no need to call reparse_configuration().

Returns a list of the additional configuration sources used in this object.

Returns the current locale.

Set Locale

Ensures that the configuration file contains a certain update. If the configuration file does not contain the update id as contained in updateFile, kconf_update is run to update the configuration file. If you install config update files with critical fixes you may wish to use this method to verify that a critical update has indeed been performed to catch the case where a user restores an old config file from backup that has not been updated yet.

Arguments
  • id : the update to check
  • update_file : the file containing the update

Implementors