bool SaveConfig( const char file[], const Config *cfg ) { FILE* fp; GKeyFile *keyfile; gchar *str; gsize len; bool succ; succ = false; keyfile = g_key_file_new(); g_key_file_set_value( keyfile, kMainSec, kAdapterKey, cfg->adapter ); g_key_file_set_integer( keyfile, kMainSec, kPortKey, cfg->dst_port ); g_key_file_set_integer( keyfile, kMainSec, kFilterKey, cfg->filter ); g_key_file_set_value( keyfile, kMainSec, kFilterWordsKey, cfg->filterwords ); g_key_file_set_integer( keyfile, kMainSec, kFilterIdURLKey, cfg->filteridurl ); g_key_file_set_integer( keyfile, kMainSec, kCheckUpdateKey, cfg->checkupdate ); str = g_key_file_to_data( keyfile, &len, NULL ); fp = fopen( file, "w" ); if( fp != NULL ) { fwrite( str, len, 1, fp ); succ = true; fclose( fp ); }//end if g_free( str ); g_key_file_free( keyfile ); return succ; }//end SaveConfig
void button_save_conf_clicked (GtkButton *button, gpointer user_data){ GError *error=NULL; GKeyFile *key_file; gchar *filename; FZ_Advanced *field = user_data; /*if (!conn) if (connection() != 0){ g_print("Configure a Conexão do Sistema"); return; } */ key_file = g_key_file_new(); // Attrs gchar *host = gtk_entry_get_text(field->Host); if (!host) host = "localhost"; g_key_file_set_value (key_file, "DBConf", "IP", host); //g_free (host); gint port = gtk_spin_button_get_value_as_int (field->Port); if (!port) port = 5432; g_key_file_set_integer (key_file, "DBConf", "port", port); gchar *login = gtk_entry_get_text(field->Login); g_key_file_set_value (key_file, "DBConf", "user", login); //g_free (login); gchar *password = gtk_entry_get_text(field->PassWord); int len_password = gtk_entry_get_text_length(field->PassWord); if (len_password){ g_key_file_set_integer (key_file, "DBConf", "len", len_password); password = g_utf8_strreverse (password, len_password); password = g_base64_encode (password, len_password); g_key_file_set_value (key_file, "DBConf", "password", password); //g_free (password); } filename = g_strdup_printf("%s/%s", g_get_home_dir (), LOCAL_SHARE); if (!g_file_test (filename, G_FILE_TEST_IS_DIR)) if ( g_mkdir(filename, 0777) == -1 ) g_print("Error: Criar Dir.\n"); filename = g_build_filename (filename, "firezero.conf", NULL); if (!g_key_file_save_to_file (key_file, filename, &error)) g_print("ERROR: %s\n", error->message);//TODO Create Dialog g_key_file_free (key_file); g_free (filename); // //TODO using to field DBConf and to save in filename // }
static void each_keyval (const char *group, ContactInfo *cinfo, MuContacts *self) { /* use set value so the string do not necessarily have to be * valid utf-8 */ if (cinfo->_name) g_key_file_set_value (self->_ccache, group, NAME_KEY, cinfo->_name); g_key_file_set_value (self->_ccache, group, EMAIL_KEY, cinfo->_email); g_key_file_set_integer (self->_ccache, group, TSTAMP_KEY, (int)cinfo->_tstamp); }
void _nm_keyfile_copy (GKeyFile *dst, GKeyFile *src) { gs_strfreev char **groups = NULL; guint g, k; groups = g_key_file_get_groups (src, NULL); for (g = 0; groups && groups[g]; g++) { const char *group = groups[g]; gs_strfreev char **keys = NULL; keys = g_key_file_get_keys (src, group, NULL, NULL); if (!keys) continue; for (k = 0; keys[k]; k++) { const char *key = keys[k]; gs_free char *value = NULL; value = g_key_file_get_value (src, group, key, NULL); if (value) g_key_file_set_value (dst, group, key, value); else g_key_file_remove_key (dst, group, key, NULL); } } }
/** Store HostID in config file. * * @param host_id A null terminated string containing a valid HostID. */ static int userpref_set_host_id(const char *host_id) { GKeyFile *key_file; gsize length; gchar *buf, *config_file; GIOChannel *file; if (!host_id) return 0; /* Make sure config directory exists */ userpref_create_config_dir(); /* Now parse file to get the HostID */ key_file = g_key_file_new(); /* Store in config file */ log_debug_msg("%s: setting hostID to %s\n", __func__, host_id); g_key_file_set_value(key_file, "Global", "HostID", host_id); /* Write config file on disk */ buf = g_key_file_to_data(key_file, &length, NULL); config_file = g_build_path(G_DIR_SEPARATOR_S, g_get_user_config_dir(), LIBIPHONE_CONF_DIR, LIBIPHONE_CONF_FILE, NULL); file = g_io_channel_new_file(config_file, "w", NULL); g_free(config_file); g_io_channel_write_chars(file, buf, length, NULL, NULL); g_io_channel_shutdown(file, TRUE, NULL); g_io_channel_unref(file); g_key_file_free(key_file); return 1; }
gboolean mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path) { mc_config_t *tmp_config; gchar **groups, **curr_grp; gchar **keys, **curr_key; gchar *value; if (mc_config == NULL) { return FALSE; } tmp_config = mc_config_init (ini_path); if (tmp_config == NULL) return FALSE; groups = mc_config_get_groups (tmp_config, NULL); for (curr_grp = groups; *curr_grp != NULL; curr_grp++) { keys = mc_config_get_keys (tmp_config, *curr_grp, NULL); for (curr_key = keys; *curr_key != NULL; curr_key++) { value = g_key_file_get_value (tmp_config->handle, *curr_grp, *curr_key, NULL); if (value == NULL) continue; g_key_file_set_value (mc_config->handle, *curr_grp, *curr_key, value); g_free (value); } g_strfreev (keys); } g_strfreev (groups); mc_config_deinit (tmp_config); return TRUE; }
static gboolean gst_preset_default_set_meta (GstPreset * preset, const gchar * name, const gchar * tag, const gchar * value) { GKeyFile *presets; gchar *key; /* get the presets from the type */ if (!(presets = preset_get_keyfile (preset))) goto no_presets; key = g_strdup_printf ("_meta/%s", tag); if (value && *value) { g_key_file_set_value (presets, name, key, value); } else { g_key_file_remove_key (presets, name, key, NULL); } g_free (key); /* save updated keyfile */ return gst_preset_default_save_presets_file (preset); /* ERRORS */ no_presets: { GST_WARNING_OBJECT (preset, "no presets"); return FALSE; } }
void moloch_config_load_includes(char **includes) { int i, g, k; for (i = 0; includes[i]; i++) { GKeyFile *keyFile = g_key_file_new(); GError *error = 0; gboolean status = g_key_file_load_from_file(keyFile, includes[i], G_KEY_FILE_NONE, &error); if (!status || error) { printf("Couldn't load config includes file (%s) %s\n", includes[i], (error?error->message:"")); exit(1); } gchar **groups = g_key_file_get_groups (keyFile, NULL); for (g = 0; groups[g]; g++) { gchar **keys = g_key_file_get_keys (keyFile, groups[g], NULL, NULL); for (k = 0; keys[k]; k++) { char *value = g_key_file_get_value(keyFile, groups[g], keys[k], NULL); if (value && !error) { g_key_file_set_value(molochKeyFile, groups[g], keys[k], value); g_free(value); } } g_strfreev(keys); } g_strfreev(groups); g_key_file_free(keyFile); } }
/* Serialize the top-level profiles * Note: They don't have to be containerprofiles */ static gboolean serialize_encoding_profile (GKeyFile * out, GstEncodingProfile * prof) { gchar *profgroupname; const GList *tmp; guint i; const gchar *profname, *profdesc, *profpreset, *proftype; GstCaps *profformat; profname = gst_encoding_profile_get_name (prof); profdesc = gst_encoding_profile_get_description (prof); profformat = gst_encoding_profile_get_format (prof); profpreset = gst_encoding_profile_get_preset (prof); proftype = gst_encoding_profile_get_type_nick (prof); profgroupname = g_strdup_printf ("profile-%s", profname); g_key_file_set_string (out, profgroupname, "name", profname); g_key_file_set_value (out, profgroupname, "type", proftype); if (profdesc) { gchar *locale; locale = get_locale (); if (locale != NULL) { g_key_file_set_locale_string (out, profgroupname, "description", locale, profdesc); g_free (locale); } else { g_key_file_set_string (out, profgroupname, "description", profdesc); } } if (profformat) { gchar *tmpc = gst_caps_to_string (profformat); g_key_file_set_string (out, profgroupname, "format", tmpc); g_free (tmpc); } if (profpreset) g_key_file_set_string (out, profgroupname, "preset", profpreset); /* stream profiles */ if (GST_IS_ENCODING_CONTAINER_PROFILE (prof)) { for (tmp = gst_encoding_container_profile_get_profiles (GST_ENCODING_CONTAINER_PROFILE (prof)), i = 0; tmp; tmp = tmp->next, i++) { GstEncodingProfile *sprof = (GstEncodingProfile *) tmp->data; if (!serialize_stream_profiles (out, sprof, profname, i)) return FALSE; } } if (profformat) gst_caps_unref (profformat); g_free (profgroupname); return TRUE; }
void config_write() { assert(m_config_file != NULL); GKeyFile * kf = g_key_file_new(); g_key_file_set_integer(kf, "StatusIcon", "stepsize", m_stepsize); g_key_file_set_boolean(kf, "StatusIcon", "lmb_slider", m_lmb_slider); g_key_file_set_boolean(kf, "StatusIcon", "mmb_mute", m_mmb_mute); g_key_file_set_boolean(kf, "StatusIcon", "use_horizontal_slider", m_use_horizontal_slider); g_key_file_set_boolean(kf, "StatusIcon", "show_sound_level", m_show_sound_level); g_key_file_set_boolean(kf, "Hotkeys", "up_enabled", m_hotkey_up_enabled); g_key_file_set_boolean(kf, "Hotkeys", "down_enabled", m_hotkey_down_enabled); g_key_file_set_boolean(kf, "Hotkeys", "mute_enabled", m_hotkey_mute_enabled); if(m_helper_program) g_key_file_set_value(kf, "StatusIcon", "onclick", m_helper_program); if(m_theme) g_key_file_set_value(kf, "StatusIcon", "theme", m_theme); if(m_card) g_key_file_set_value(kf, "Alsa", "card", m_card); if(m_channel) g_key_file_set_value(kf, "Alsa", "channel", m_channel); if(m_hotkey_up) g_key_file_set_value(kf, "Hotkeys", "up", m_hotkey_up); if(m_hotkey_down) g_key_file_set_value(kf, "Hotkeys", "down", m_hotkey_down); if(m_hotkey_mute) g_key_file_set_value(kf, "Hotkeys", "mute", m_hotkey_mute); gsize length; gchar * data = g_key_file_to_data(kf, &length, NULL); g_file_set_contents(m_config_file, data, -1, NULL); g_free(data); g_key_file_free(kf); }
/* * callback used in gtk_print_settings_foreach loop */ static void print_settings_add_to_key_file (const gchar *key, const gchar *value, gpointer data) { GKeyFile *key_file = data; g_key_file_set_value (key_file, PRINT_SETTINGS_NAME, key, value); }
void ags_config_real_set_value(AgsConfig *config, gchar *group, gchar *key, gchar *value) { AgsApplicationContext *application_context; application_context = config->application_context; g_key_file_set_value(config->key_file, group, key, value); }
void mc_config_set_string_raw_value (mc_config_t * mc_config, const gchar * group, const gchar * param, const gchar * value) { if (!mc_config || !group || !param || !value) return; g_key_file_set_value (mc_config->handle, group, param, value); }
static void key_file_set_base64 (GKeyFile *key_file, const gchar *section, const gchar *field, gconstpointer data, gsize n_data) { gchar *value; value = g_base64_encode (data, n_data); g_key_file_set_value (key_file, section, field, value); g_free (value); }
/* copies all keys and comments from one group to another, deleting the old * group. */ static gboolean gst_preset_default_rename_preset (GstPreset * preset, const gchar * old_name, const gchar * new_name) { GKeyFile *presets; gchar *str; gchar **keys; gsize i, num_keys; /* get the presets from the type */ if (!(presets = preset_get_keyfile (preset))) goto no_presets; if (!g_key_file_has_group (presets, old_name)) goto no_group; /* copy group comment if there is any */ if ((str = g_key_file_get_comment (presets, old_name, NULL, NULL))) { g_key_file_set_comment (presets, new_name, NULL, str, NULL); g_free (str); } /* get all keys from the old group and copy them in the new group */ keys = g_key_file_get_keys (presets, old_name, &num_keys, NULL); for (i = 0; i < num_keys; i++) { /* copy key comment if there is any */ if ((str = g_key_file_get_comment (presets, old_name, keys[i], NULL))) { g_key_file_set_comment (presets, new_name, keys[i], str, NULL); g_free (str); } /* copy key value */ str = g_key_file_get_value (presets, old_name, keys[i], NULL); g_key_file_set_value (presets, new_name, keys[i], str); g_free (str); } g_strfreev (keys); /* remove old group */ g_key_file_remove_group (presets, old_name, NULL); /* save updated version */ return gst_preset_default_save_presets_file (preset); /* ERRORS */ no_presets: { GST_WARNING_OBJECT (preset, "no presets"); return FALSE; } no_group: { GST_WARNING_OBJECT (preset, "no preset named %s", old_name); return FALSE; } }
/** * fm_folder_config_set_uint64 * @fc: a configuration descriptor * @key: a key to search * @val: data to set * * Associates unsigned integer @val with @key for given folder configuration. * * Since: 1.2.0 */ void fm_folder_config_set_uint64(FmFolderConfig *fc, const char *key, guint64 val) { fc->changed = TRUE; #if GLIB_CHECK_VERSION(2, 26, 0) g_key_file_set_uint64(fc->kf, fc->group, key, val); #else gchar *result = g_strdup_printf("%" G_GUINT64_FORMAT, val); g_key_file_set_value(fc->kf, fc->group, key, result); g_free(result); #endif }
/** * g_key_file_set_uint64: * @key_file: a #GKeyFile * @group_name: a group name * @key: a key * @value: an integer value * * Associates a new integer value with @key under @group_name. * If @key cannot be found then it is created. * * Since: 2.26 **/ void g_key_file_set_uint64 (GKeyFile *key_file, const gchar *group_name, const gchar *key, guint64 value) { gchar *result; g_return_if_fail (key_file != NULL); result = g_strdup_printf ("%" G_GUINT64_FORMAT, value); g_key_file_set_value (key_file, group_name, key, result); g_free (result); }
gboolean blog_add (const GtkWidget *wid, const gchar *disname) { GKeyFile *gkf; GtkEntry *entry; gchar *content, *token; const gchar *entrytext; gsize size; renrenblog_t *blog; entry = g_object_get_data (G_OBJECT (wid), "token_entry"); entrytext = gtk_entry_get_text (entry); token = get_token_from_uri (entrytext); g_return_val_if_fail (token, FALSE); blog = g_malloc (sizeof (renrenblog_t)); g_return_val_if_fail (blog, FALSE); blog->core->name = g_strdup (disname); blog->core->plugin_name = g_strdup (module_name ()); blog->core->enable = TRUE; blog->token = token; #ifndef WIN32 blog_list = g_list_append (blog_list, blog); #else *blog_list_p = g_list_append (*blog_list_p, blog); #endif if (g_inifile == NULL) { g_inifile = am_realpath ("~/.amblog/renrenblog"); } g_return_val_if_fail (g_inifile, FALSE); gkf = g_key_file_new (); g_key_file_load_from_file (gkf, g_inifile, G_KEY_FILE_NONE, NULL); g_key_file_set_value (gkf, disname, "token", token); content = g_key_file_to_data (gkf, &size, NULL); g_file_set_contents (g_inifile, content, size, NULL); g_key_file_free (gkf); return TRUE; }
void mc_config_direct_set_string (mc_config_t * mc_config, const gchar * group, const gchar * param, const gchar * value) { gchar *buffer; if (!mc_config || !group || !param || !value) return; buffer = mc_config_normalize_before_save(value); g_key_file_set_value (mc_config->handle, group, param, buffer); g_free(buffer); }
void MetadataManager::setString(String uri, const char* name, const char* value) { XOJ_CHECK_TYPE(MetadataManager); if (uri.isEmpty()) { return; } loadConfigFile(); g_key_file_set_value(this->config, uri.c_str(), name, value); updateAccessTime(uri); }
void server_config_entries_write (GList *entries, const gchar *filename) { GKeyFile* config_file = g_key_file_new (); GList *list = entries; while (list != NULL){ ServerConfigEntry *entry; entry = list->data; if (entry != NULL) { g_key_file_set_value (config_file, entry->name, CONFIG_KEY_HOST, entry->host != NULL ? entry->host : EMPTY_STRING); g_key_file_set_value (config_file, entry->name, CONFIG_KEY_PORT, entry->port != NULL ? entry->port : EMPTY_STRING); g_key_file_set_value (config_file, entry->name, CONFIG_KEY_SSLMODE, entry->sslmode != NULL ? entry->sslmode : EMPTY_STRING); g_key_file_set_value (config_file, entry->name, CONFIG_KEY_DBNAME, entry->dbname != NULL ? entry->dbname : EMPTY_STRING); } list = g_list_next (list); } write_config_file (filename, config_file); g_key_file_free (config_file); }
void set_string (const char * section, const char * name, const char * value) { g_return_if_fail (defaults && keyfile); g_return_if_fail (name && value); pthread_mutex_lock (& mutex); if (! section) section = DEFAULT_SECTION; const char * def = get_default (section, name); bool_t changed = FALSE; if (! strcmp (value, def)) { if (g_key_file_has_key (keyfile, section, name, NULL)) { g_key_file_remove_key (keyfile, section, name, NULL); changed = TRUE; } } else { char * old = g_key_file_has_key (keyfile, section, name, NULL) ? g_key_file_get_value (keyfile, section, name, NULL) : NULL; if (! old || strcmp (value, old)) { g_key_file_set_value (keyfile, section, name, value); changed = TRUE; } g_free (old); } if (changed) { modified = TRUE; if (! strcmp (section, DEFAULT_SECTION)) { char * event = g_strdup_printf ("set %s", name); event_queue (event, NULL); g_free (event); } } pthread_mutex_unlock (& mutex); }
gboolean mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path, gboolean read_only, gboolean remove_empty) { mc_config_t *tmp_config; gchar **groups, **curr_grp; gchar **keys, **curr_key; gchar *value; if (mc_config == NULL) return FALSE; tmp_config = mc_config_init (ini_path, read_only); if (tmp_config == NULL) return FALSE; groups = mc_config_get_groups (tmp_config, NULL); if (groups == NULL) { mc_config_deinit (tmp_config); return FALSE; } for (curr_grp = groups; *curr_grp != NULL; curr_grp++) { keys = mc_config_get_keys (tmp_config, *curr_grp, NULL); for (curr_key = keys; *curr_key != NULL; curr_key++) { value = g_key_file_get_value (tmp_config->handle, *curr_grp, *curr_key, NULL); if (value != NULL) { if (*value == '\0' && remove_empty) g_key_file_remove_key (mc_config->handle, *curr_grp, *curr_key, NULL); else g_key_file_set_value (mc_config->handle, *curr_grp, *curr_key, value); g_free (value); } else if (remove_empty) g_key_file_remove_key (mc_config->handle, *curr_grp, *curr_key, NULL); } g_strfreev (keys); } g_strfreev (groups); mc_config_deinit (tmp_config); return TRUE; }
static void preset_merge (GKeyFile * system, GKeyFile * user) { gchar *str; gchar **groups, **keys; gsize i, j, num_groups, num_keys; /* copy file comment if there is any */ if ((str = g_key_file_get_comment (user, NULL, NULL, NULL))) { g_key_file_set_comment (system, NULL, NULL, str, NULL); g_free (str); } /* get groups in user and copy into system */ groups = g_key_file_get_groups (user, &num_groups); for (i = 0; i < num_groups; i++) { /* copy group comment if there is any */ if ((str = g_key_file_get_comment (user, groups[i], NULL, NULL))) { g_key_file_set_comment (system, groups[i], NULL, str, NULL); g_free (str); } /* ignore private groups */ if (groups[i][0] == '_') continue; /* if group already exists in system, remove and re-add keys from user */ if (g_key_file_has_group (system, groups[i])) { g_key_file_remove_group (system, groups[i], NULL); } keys = g_key_file_get_keys (user, groups[i], &num_keys, NULL); for (j = 0; j < num_keys; j++) { /* copy key comment if there is any */ if ((str = g_key_file_get_comment (user, groups[i], keys[j], NULL))) { g_key_file_set_comment (system, groups[i], keys[j], str, NULL); g_free (str); } str = g_key_file_get_value (user, groups[i], keys[j], NULL); g_key_file_set_value (system, groups[i], keys[j], str); g_free (str); } g_strfreev (keys); } g_strfreev (groups); }
static gboolean set_to_keyfile (GKeyfileSettingsBackend *kfsb, const gchar *key, GVariant *value) { gchar *group, *name; if (g_hash_table_contains (kfsb->system_locks, key)) return FALSE; if (convert_path (kfsb, key, &group, &name)) { if (value) { gchar *str = g_variant_print (value, FALSE); g_key_file_set_value (kfsb->keyfile, group, name, str); g_variant_unref (g_variant_ref_sink (value)); g_free (str); } else { if (*name == '\0') { gchar **groups; gint i; groups = g_key_file_get_groups (kfsb->keyfile, NULL); for (i = 0; groups[i]; i++) if (group_name_matches (groups[i], group)) g_key_file_remove_group (kfsb->keyfile, groups[i], NULL); g_strfreev (groups); } else g_key_file_remove_key (kfsb->keyfile, group, name, NULL); } g_free (group); g_free (name); return TRUE; } return FALSE; }
static void set_string_set (GKeyFile *keyfile, const gchar *group, const gchar *key, GHashTable *set) { GHashTableIter iter; GString *list; gpointer item; list = g_string_new (NULL); g_hash_table_iter_init (&iter, set); while (g_hash_table_iter_next (&iter, &item, NULL)) g_string_append_printf (list, "%s;", (const gchar *) item); g_key_file_set_value (keyfile, group, key, list->str); g_string_free (list, TRUE); }
/** * Merge one GKeyFile into another. */ static void configuration_merge (GKeyFile *to, GKeyFile *from) { gchar **groups, **keys, *value; gint i, j; groups = g_key_file_get_groups (from, NULL); for (i = 0; groups[i] != NULL; i++) { keys = g_key_file_get_keys (from, groups[i], NULL, NULL); for (j = 0; keys[j] != NULL; j++) { value = g_key_file_get_value (from, groups[i], keys[j], NULL); g_key_file_set_value (to, groups[i], keys[j], value); g_free (value); } g_strfreev (keys); } g_strfreev (groups); }
void dfu_key_file_remove_list (GKeyFile *keyfile, const char *group, const char *key, const char *to_remove) { char **values; GString *value; gboolean found; int i; g_return_if_fail (keyfile != NULL); found = FALSE; value = g_string_new (""); values = g_key_file_get_string_list (keyfile, group, key, NULL, NULL); if (values) { for (i = 0; values[i] != NULL; i++) { if (!strcmp (values[i], to_remove)) found = TRUE; else g_string_append_printf (value, "%s;", values[i]); } g_strfreev (values); } if (!found) { g_string_free (value, TRUE); return; } if (!value->str || value->str[0] == '\0') g_key_file_remove_key (keyfile, group, key, NULL); else g_key_file_set_value (keyfile, group, key, value->str); g_string_free (value, TRUE); }
static gboolean _dfu_key_file_copy_key_helper (GKeyFile *keyfile, const char *fromgroup, const char *fromkey, const char *togroup, const char *tokey) { char *value; if (!g_key_file_has_group (keyfile, fromgroup)) return FALSE; value = g_key_file_get_value (keyfile, fromgroup, fromkey, NULL); if (!value) return FALSE; g_key_file_set_value (keyfile, togroup, tokey, value); g_free (value); return TRUE; }
gboolean dfu_key_file_rename_group (GKeyFile *keyfile, const char *oldgroup, const char *newgroup) { char **keys; char *value; unsigned int i; g_return_val_if_fail (keyfile != NULL, FALSE); if (!g_key_file_has_group (keyfile, oldgroup)) return TRUE; keys = g_key_file_get_keys (keyfile, oldgroup, NULL, NULL); for (i = 0; keys[i] != NULL; i++) { value = g_key_file_get_value (keyfile, oldgroup, keys[i], NULL); g_key_file_set_value (keyfile, newgroup, keys[i], value); g_free (value); value = g_key_file_get_comment (keyfile, oldgroup, keys[i], NULL); if (value) { g_key_file_set_comment (keyfile, newgroup, keys[i], value, NULL); g_free (value); } } g_strfreev (keys); value = g_key_file_get_comment (keyfile, oldgroup, NULL, NULL); if (value) { g_key_file_set_comment (keyfile, newgroup, NULL, value, NULL); g_free (value); } g_key_file_remove_group (keyfile, oldgroup, NULL); return TRUE; }