static void clock_properties_save(void) { GKeyFile *keyfile; const char *str; keyfile = __connman_storage_load_global(); if (!keyfile) keyfile = g_key_file_new(); str = time_updates2string(time_updates_config); if (str) g_key_file_set_string(keyfile, "global", "TimeUpdates", str); else g_key_file_remove_key(keyfile, "global", "TimeUpdates", NULL); str = timezone_updates2string(timezone_updates_config); if (str) g_key_file_set_string(keyfile, "global", "TimezoneUpdates", str); else g_key_file_remove_key(keyfile, "global", "TimezoneUpdates", NULL); __connman_storage_save_global(keyfile); g_key_file_free(keyfile); }
static void save_state(struct connman_technology *technology) { GKeyFile *keyfile; gchar *identifier; DBG("technology %p", technology); keyfile = __connman_storage_load_global(); if (keyfile == NULL) keyfile = g_key_file_new(); identifier = g_strdup_printf("%s", get_name(technology->type)); if (identifier == NULL) goto done; g_key_file_set_boolean(keyfile, identifier, "Enable", technology->enable_persistent); done: g_free(identifier); __connman_storage_save_global(keyfile); g_key_file_free(keyfile); return; }
static void connman_technology_save_offlinemode() { GKeyFile *keyfile; keyfile = __connman_storage_load_global(); if (keyfile == NULL) keyfile = g_key_file_new(); g_key_file_set_boolean(keyfile, "global", "OfflineMode", global_offlinemode); __connman_storage_save_global(keyfile); g_key_file_free(keyfile); return; }
static void save_timeservers(char **servers) { GKeyFile *keyfile; int cnt; keyfile = __connman_storage_load_global(); if (!keyfile) keyfile = g_key_file_new(); for (cnt = 0; servers && servers[cnt]; cnt++); g_key_file_set_string_list(keyfile, "global", "Timeservers", (const gchar **)servers, cnt); __connman_storage_save_global(keyfile); g_key_file_free(keyfile); return; }