예제 #1
0
/*
 * Class:     org_eclipse_core_internal_net_UnixProxyProvider
 * Method:    getGConfNonProxyHosts
 * Signature: ()[Ljava/lang/String;
 */
JNIEXPORT jobjectArray JNICALL Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_getGConfNonProxyHosts(
		JNIEnv *env, jclass clazz) {

	if (client == NULL) {
		Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_gconfInit(env, clazz);
	}

	GSList *npHosts;
	int size;

	npHosts = gconf_client_get_list(client, "/system/http_proxy/ignore_hosts",
			GCONF_VALUE_STRING, NULL);
	size = g_slist_length(npHosts);

	// TODO - I'm not sure this is really valid, it's from the JVM implementation
	// of ProxySelector
	if (size == 0) {
		npHosts = gconf_client_get_list(client, "/system/proxy/no_proxy_for",
				GCONF_VALUE_STRING, NULL);
	}
	size = g_slist_length(npHosts);

	jobjectArray ret = (*env)->NewObjectArray(env, size, stringClass, NULL);

	ListProcContext lpc;
	lpc.env = env;
	lpc.npHostArray = ret;
	lpc.index = 0;

	g_slist_foreach(npHosts, listProc, &lpc);
	return ret;
}
예제 #2
0
ESourceList *
config_data_get_calendars (const char *key)
{
	ESourceList *cal_sources;
	gboolean state;
	GSList *gconf_list;

	if (!inited)
		conf_client = gconf_client_get_default ();

	gconf_list = gconf_client_get_list (conf_client,
					    key,
					    GCONF_VALUE_STRING,
					    NULL);
	cal_sources = e_source_list_new_for_gconf (conf_client, key);

	if (cal_sources && g_slist_length (gconf_list)) {
		g_slist_foreach (gconf_list, (GFunc) g_free, NULL);
		g_slist_free (gconf_list);
		return cal_sources;
	}

	state = gconf_client_get_bool (conf_client,
				      "/apps/evolution/calendar/notify/notify_with_tray",
				      NULL);
	if (!state) /* Should be old client*/ {
		GSList *source;
		gconf_client_set_bool (conf_client,
				      "/apps/evolution/calendar/notify/notify_with_tray",
				      TRUE,
				      NULL);
		source = gconf_client_get_list (conf_client,
						"/apps/evolution/calendar/sources",
						GCONF_VALUE_STRING,
						NULL);
		gconf_client_set_list (conf_client,
				       key,
				       GCONF_VALUE_STRING,
				       source,
				       NULL);
		cal_sources = e_source_list_new_for_gconf (conf_client, key);

		if (source) {
			g_slist_foreach (source, (GFunc) g_free, NULL);
			g_slist_free (source);
		}
	}

	if (gconf_list) {
		g_slist_foreach (gconf_list, (GFunc) g_free, NULL);
		g_slist_free (gconf_list);
	}

	return cal_sources;

}
예제 #3
0
GSList *
gm_conf_get_string_list (const gchar *key)
{
    g_return_val_if_fail (key != NULL, NULL);

    return gconf_client_get_list (client, key, GCONF_VALUE_STRING, NULL);
}
예제 #4
0
/* check for the clues */
static gboolean
check_for_attachment_clues (gchar *msg)
{
	/* TODO : Add more strings. RegEx ??? */
	GConfClient *gconf;
	GSList *clue_list = NULL, *list;
	gboolean ret_val = FALSE;
	guint msg_length;

	gconf = gconf_client_get_default ();


	/* Get the list from gconf */
	clue_list = gconf_client_get_list ( gconf, GCONF_KEY_ATTACH_REMINDER_CLUES, GCONF_VALUE_STRING, NULL );

	g_object_unref (gconf);

	msg_length = strlen (msg);
	for (list = clue_list;list && !ret_val;list=g_slist_next(list)) {
		gchar *needle = g_utf8_strdown (list->data, -1);
		if (g_strstr_len (msg, msg_length, needle)) {
			ret_val = TRUE;
		}
		g_free (needle);
	}

	if (clue_list) {
		g_slist_foreach (clue_list, (GFunc) g_free, NULL);
		g_slist_free (clue_list);
	}

	return ret_val;
}
예제 #5
0
void eee_accounts_manager_enable_account(EeeAccountsManager *self, const char *name)
{
    GSList *accounts;
    GSList *item;

    g_return_if_fail(IS_EEE_ACCOUNTS_MANAGER(self));
    g_return_if_fail(name != NULL);

    accounts = gconf_client_get_list(self->priv->gconf, EEE_KEY "disabled_accounts", GCONF_VALUE_STRING, NULL);

    while (TRUE)
    {
        item = g_slist_find_custom(accounts, name, (GCompareFunc)strcmp);
        if (item == NULL)
        {
            break;
        }
        g_free(item->data);
        accounts = g_slist_remove_link(accounts, item);
    }

    gconf_client_set_list(self->priv->gconf, EEE_KEY "disabled_accounts", GCONF_VALUE_STRING, accounts, NULL);
    g_slist_foreach(accounts, (GFunc)g_free, NULL);
    g_slist_free(accounts);
}
예제 #6
0
파일: options.c 프로젝트: AKMergl/gRDesktop
gint loadServers() {
	GSList *names;
	gint count, i;

	if(g_list_length(hostnames) != 0) {	/* empty the glist */
		while((count = g_list_length(hostnames) != 0)) {
			gchar *item;
			item = g_list_nth_data(hostnames, 0);
			hostnames = g_list_remove(hostnames, item);
		}
	}

	names = gconf_client_get_list(gcfg, GCONF_BASE"/hostnames",
		GCONF_VALUE_STRING, NULL);
	count = g_slist_length(names);
	for(i=0; i<count; i++) {
		gchar *name;
		name = g_slist_nth_data(names, i);
		hostnames = g_list_append(hostnames, g_strdup(name));
	}

	if(g_list_length(hostnames) == 0)
		return(1);
	return(0);
}
예제 #7
0
/* The current list of memo lists selected */
GSList   *
calendar_config_get_memos_selected (void)
{
	calendar_config_init ();

	return gconf_client_get_list (config, CALENDAR_CONFIG_MEMOS_SELECTED_MEMOS, GCONF_VALUE_STRING, NULL);
}
static void 
awn_applet_manger_refresh_applets (GConfClient *client, 
                                   guint cid, 
                                   GConfEntry *entry, 
                                   AwnAppletManager *manager)
{
	AwnAppletManagerPrivate *priv;
	GError *err = NULL;
	GSList *keys = NULL, *k;
        gint i = 0;
	
	g_return_if_fail (AWN_IS_APPLET_MANAGER (manager));
	priv = AWN_APPLET_MANAGER_GET_PRIVATE (manager);     
	
	keys = gconf_client_get_list (client,
                                      AWN_APPLETS_KEY,
                                      GCONF_VALUE_STRING,
                                      &err); 

        if (keys == NULL || err) {
                if (err)
                        g_print ("%s\n", err->message);
                return;        
        }
        
        /* Set the current applets to untouched */
        g_hash_table_foreach (priv->applets, (GHFunc)_zero_applets, manager);
        
        /* Re-order the list & make those which are new */
        for (k = keys; k != NULL; k = k->next) {
                GtkWidget *applet = NULL;
                
                gchar **tokens = NULL;
                tokens = g_strsplit (k->data, "::", 2);
                
                if (tokens == NULL) {
                        g_warning ("Bad key: %s", (gchar*)k->data);
                        continue;
                }
                
                applet = g_hash_table_lookup (priv->applets, tokens[1]);
                
                if (!applet) {
                        g_print ("Creating new applet :%s uid:%s\n", 
                                 tokens[0],
                                 tokens[1]);
                        applet =  _create_applet (manager, tokens[0], tokens[1]);
                }
                
                gtk_box_reorder_child (GTK_BOX (manager),GTK_WIDGET (applet),i);
                g_object_set_qdata (G_OBJECT (applet), 
                                    touch_quark, GINT_TO_POINTER (1));

                g_strfreev (tokens);
                i++;
        }
        
        /* foreach applet that wasn't in the list, delete it */
        g_hash_table_foreach (priv->applets, (GHFunc)_kill_applets, manager);
}
예제 #9
0
/* Find current selected city for the clock applet with the specified id.
   Returns NULL if not found. */
static char *
find_current_city(GConfClient *client, const char *id)
{
	char *current_city = NULL;
	char *cities_key = g_strdup_printf("/apps/panel/applets/%s"
					   "/prefs/cities", id);
	GSList *cities = gconf_client_get_list(client,
					       cities_key,
					       GCONF_VALUE_STRING, NULL);

	if (cities == NULL) {
		fprintf(stderr, _("Error reading city list: `%s'.\n"),
			cities_key);
		g_free(cities_key);
		return NULL;
	}

	g_free(cities_key);

	for (GSList *city = cities; city != NULL;
	     city = g_slist_next(city)) {
		char *city_spec = city->data;
		char *c = strstr(city_spec, "current=\"true\"");
		if (c) current_city = g_strdup(city_spec);
		g_free(city->data);
	}
	g_slist_free(cities);

	return current_city;
}
예제 #10
0
static void
gconf_bookmarks_dialog_populate_model (GConfBookmarksDialog *dialog)
{
	GConfClient *client;
	GSList *value_list, *p;
	GtkTreeIter iter;
	
	client = gconf_client_get_default ();
	
	/* First clear the list store */
	dialog->changing_model = TRUE;
	gtk_list_store_clear (dialog->list_store);

	value_list = gconf_client_get_list (client, BOOKMARKS_KEY,
					    GCONF_VALUE_STRING, NULL);

	for (p = value_list; p; p = p->next) {
		gtk_list_store_append (dialog->list_store, &iter);
		gtk_list_store_set (dialog->list_store, &iter,
				    0, p->data,
				    -1);
		g_free (p->data);
	}

	if (value_list)
		g_slist_free (value_list);

	dialog->changing_model = FALSE;

	g_object_unref (client);
}
예제 #11
0
파일: main.c 프로젝트: hsgg/quark
static void
config_load (GConfClient *gconf)
{
    GSList *paths, *it;

    main_set_loop_at_end (gconf_client_get_bool (gconf, LOOP_PLAYLIST, NULL));
    main_set_random_order (gconf_client_get_bool (gconf, RANDOM_ORDER, NULL));

    paths = gconf_client_get_list (gconf, PLAYLIST, GCONF_VALUE_STRING, NULL);
    for (it = paths; it; it = g_slist_next (it)) {
        GError *e = NULL;
        gchar *p = g_filename_from_utf8 (it->data, -1, NULL, NULL, &e);
        if (p) { playlist_append_single (p); g_free(p); }
        if (e) {
            g_warning ("Error loading playlist: %s", e->message);
            g_error_free(e);
        }
        g_free(it->data);
    }
    g_slist_free(paths);

    /* don't need another copy of the playlist in memory, and
       gconf_client_clear_cache makes a nice segfault when I try save stuff
       later. This value can't be edited while quark is running anyways.
    */
    gconf_client_unset (gconf, PLAYLIST, NULL);

    playlist_seek (gconf_client_get_int (gconf, PLAYLIST_POSITION, NULL));
}
예제 #12
0
NS_IMETHODIMP
nsGConfService::GetStringList(const nsACString &aKey, nsIArray** aResult)
{
  nsCOMPtr<nsIMutableArray> items(do_CreateInstance(NS_ARRAY_CONTRACTID));
  if (!items)
    return NS_ERROR_OUT_OF_MEMORY;
    
  GError* error = nsnull;
  GSList* list = gconf_client_get_list(mClient, PromiseFlatCString(aKey).get(),
                                       GCONF_VALUE_STRING, &error);
  if (error) {
    g_error_free(error);
    return NS_ERROR_FAILURE;
  }

  for (GSList* l = list; l; l = l->next) {
    nsCOMPtr<nsISupportsString> obj(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
    if (!obj) {
      g_slist_free(list);
      return NS_ERROR_OUT_OF_MEMORY;
    }
    obj->SetData(NS_ConvertUTF8toUTF16((const char*)l->data));
    items->AppendElement(obj, PR_FALSE);
    g_free(l->data);
  }
  
  g_slist_free(list);
  NS_ADDREF(*aResult = items);
  return NS_OK;
}
예제 #13
0
static void
unsubscribe_dialog_response (GtkDialog *dialog, int response, gpointer data)
{

	if (response == GTK_RESPONSE_OK) {
		GSList *ids, *node_to_be_deleted;
		ExchangeAccount *account = NULL;
		gchar *path = NULL;
		gchar *ruri = NULL;
		const char *source_uid = NULL;
		GConfClient *client;
		ESourceGroup *source_group = NULL;
		ESource *source = NULL;
		ECalPopupTargetSource *target = data;

		client = gconf_client_get_default ();

		account = exchange_operations_get_exchange_account ();

		if (!account)
			return;

		source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector));
		ruri = (gchar *) e_source_peek_relative_uri (source);
		source_uid = e_source_peek_uid (source);

		path = g_strdup (ruri + strlen (account->account_filename));
		exchange_account_remove_shared_folder (account, path);
		ids = gconf_client_get_list (client,
					     CONF_KEY_SELECTED_CAL_SOURCES,
					     GCONF_VALUE_STRING, NULL);
		if (ids) {
			node_to_be_deleted = g_slist_find_custom (
						ids,
						source_uid,
						(GCompareFunc) strcmp);
			if (node_to_be_deleted) {
				g_free (node_to_be_deleted->data);
				ids = g_slist_delete_link (ids,
						node_to_be_deleted);
				gconf_client_set_list (client,
					CONF_KEY_SELECTED_CAL_SOURCES,
					GCONF_VALUE_STRING, ids, NULL);
			}
			g_slist_foreach (ids, (GFunc) g_free, NULL);
			g_slist_free (ids);
		}

		source_group = e_source_peek_group (source);
		e_source_group_remove_source_by_uid (source_group, source_uid);
		g_free (path);
		gtk_widget_destroy (GTK_WIDGET (dialog));
	}
	if (response == GTK_RESPONSE_CANCEL)
		gtk_widget_destroy (GTK_WIDGET (dialog));
	if (response == GTK_RESPONSE_DELETE_EVENT)
		gtk_widget_destroy (GTK_WIDGET (dialog));
}
예제 #14
0
static void
calendar_sources_load_sources (CalendarSources    *sources,
			       CalendarSourceData *source_data,
			       const char         *sources_key,
			       const char         *selected_sources_key,
			       const char         *selected_sources_dir)
{
  GConfClient *gconf_client;
  GError      *error;

  dprintf ("---------------------------\n");
  dprintf ("Loading sources:\n");
  dprintf ("  sources_key: %s\n", sources_key);
  dprintf ("  selected_sources_key: %s\n", selected_sources_key);
  dprintf ("  selected_sources_dir: %s\n", selected_sources_dir);

  gconf_client = sources->priv->gconf_client;

  error = NULL;
  source_data->selected_sources = gconf_client_get_list (gconf_client,
							 selected_sources_key,
							 GCONF_VALUE_STRING,
							 &error);
  if (error)
    {
      g_warning ("Failed to get selected sources from '%s': %s\n",
		 selected_sources_key,
		 error->message);
      g_error_free (error);
      return;
    }

  gconf_client_add_dir (gconf_client,
			selected_sources_dir,
			GCONF_CLIENT_PRELOAD_NONE,
			NULL);
  source_data->selected_sources_dir = g_strdup (selected_sources_dir);

  source_data->selected_sources_listener =
    gconf_client_notify_add (gconf_client,
			     selected_sources_dir,
			     (GConfClientNotifyFunc) calendar_sources_selected_sources_notify,
			     source_data, NULL, NULL);

  source_data->esource_list = e_source_list_new_for_gconf (gconf_client, sources_key);
  g_signal_connect (source_data->esource_list, "changed",
		    G_CALLBACK (calendar_sources_esource_list_changed),
		    source_data);

  calendar_sources_load_esource_list (source_data);

  source_data->loaded = TRUE;

  dprintf ("---------------------------\n");
}
static void
default_mixer_tracks_notify (GConfClient *client, guint cnxn_id, GConfEntry *entry, GladeXML *dialog)
{
	GSList *tracks;

	tracks = gconf_client_get_list (gconf_client, DEFAULT_MIXER_TRACKS_KEY, GCONF_VALUE_STRING, NULL);

	update_mixer_tracks_selection (tracks, dialog);

	g_slist_foreach (tracks, (GFunc) g_free, NULL);
	g_slist_free (tracks);
}
예제 #16
0
static void construct_gl_http_proxy(gboolean use_proxy)
{
    g_free(gl_http_proxy);
    gl_http_proxy = NULL;

    g_slist_foreach(gl_ignore_hosts, (GFunc) g_free, NULL);
    g_slist_free(gl_ignore_hosts);
    gl_ignore_hosts = NULL;
    g_slist_foreach(gl_ignore_addrs, (GFunc) g_free, NULL);
    g_slist_free(gl_ignore_addrs);
    gl_ignore_addrs = NULL;

    if (use_proxy) {
	char *proxy_host;
	int proxy_port;
	GSList *ignore;

	proxy_host =
	    gconf_client_get_string(gl_client,
				    KEY_GCONF_HTTP_PROXY_HOST, NULL);
	proxy_port =
	    gconf_client_get_int(gl_client,
				 KEY_GCONF_HTTP_PROXY_PORT, NULL);

	if (proxy_host && proxy_host[0] != '\0') {
	    if (0 != proxy_port && 0xffff >= (unsigned) proxy_port) {
		gl_http_proxy =
		    g_strdup_printf("%s:%u", proxy_host, (unsigned)
				    proxy_port);
	    } else {
		gl_http_proxy =
		    g_strdup_printf("%s:%u", proxy_host, (unsigned)
				    DEFAULT_HTTP_PROXY_PORT);
	    }
	    DEBUG_HTTP(("New HTTP proxy: '%s'", gl_http_proxy));
	} else {
	    DEBUG_HTTP(("HTTP proxy unset"));
	}

	g_free(proxy_host);
	proxy_host = NULL;

	ignore = gconf_client_get_list(gl_client,
				       KEY_GCONF_HTTP_PROXY_IGNORE_HOSTS,
				       GCONF_VALUE_STRING, NULL);
	g_slist_foreach(ignore, (GFunc) parse_ignore_host, NULL);
	g_slist_foreach(ignore, (GFunc) g_free, NULL);
	g_slist_free(ignore);
	ignore = NULL;
    }
}
예제 #17
0
GSList *
marina_prefs_get_active_plugins (void)
{
  GSList *plugins;

  marina_debug (DEBUG_PREFS);

  g_return_val_if_fail (gconf_client != NULL, NULL);

  plugins = gconf_client_get_list (gconf_client,
                                   MPM_ACTIVE_PLUGINS,
                                   GCONF_VALUE_STRING, 
                                   NULL);

  return plugins;
}
예제 #18
0
gboolean eee_accounts_manager_account_is_disabled(EeeAccountsManager *self, const char *name)
{
    GSList *accounts;
    gboolean disabled;

    g_return_val_if_fail(IS_EEE_ACCOUNTS_MANAGER(self), FALSE);
    g_return_val_if_fail(name != NULL, FALSE);

    accounts = gconf_client_get_list(self->priv->gconf, EEE_KEY "disabled_accounts", GCONF_VALUE_STRING, NULL);

    disabled = !!g_slist_find_custom(accounts, name, (GCompareFunc)strcmp);

    g_slist_foreach(accounts, (GFunc)g_free, NULL);
    g_slist_free(accounts);

    return disabled;
}
예제 #19
0
GSList *
eel_gconf_get_string_list (const char *key)
{
    GSList *slist;
    GConfClient *client;
    GError *error;

    g_return_val_if_fail (key != NULL, NULL);

    client = eel_gconf_client_get_global ();
    g_return_val_if_fail (client != NULL, NULL);

    error = NULL;
    slist = gconf_client_get_list (client, key, GCONF_VALUE_STRING, &error);
    if (eel_gconf_handle_error (&error)) {
        slist = NULL;
    }

    return slist;
}
예제 #20
0
/* these method are useful to manipulate disabled accounts list, these are
 * account names that plugin should not try to access or show in any way, user
 * can disable/enable account only manually using evo. account preferences */
void eee_accounts_manager_disable_account(EeeAccountsManager *self, const char *name)
{
    GSList *accounts;

    g_return_if_fail(IS_EEE_ACCOUNTS_MANAGER(self));
    g_return_if_fail(name != NULL);

    if (eee_accounts_manager_account_is_disabled(self, name))
    {
        return;
    }

    accounts = gconf_client_get_list(self->priv->gconf, EEE_KEY "disabled_accounts", GCONF_VALUE_STRING, NULL);

    accounts = g_slist_append(accounts, g_strdup(name));

    gconf_client_set_list(self->priv->gconf, EEE_KEY "disabled_accounts", GCONF_VALUE_STRING, accounts, NULL);
    g_slist_foreach(accounts, (GFunc)g_free, NULL);
    g_slist_free(accounts);
}
예제 #21
0
void
search_preferences_init(void)
{
	GConfClient *client;
	GSList *list;
	GtkTreeModel *model;
	GtkTreeIter iter;

	sr = create_search_replace_instance(NULL);

	search_preferences_add_treeview(BASIC);
	
	client = gconf_client_get_default();
	gconf_client_add_dir(client, SEARCH_PREF_PATH, GCONF_CLIENT_PRELOAD_NONE, NULL);
	
	list_pref = gconf_client_get_list(client,gconf_concat_dir_and_key(SEARCH_PREF_PATH, 
	                                  "list_pref"), GCONF_VALUE_STRING, NULL);
		
	for (list = list_pref; list != NULL; list = g_slist_next(list))
		search_preferences_add_treeview(list->data);
	
	default_pref = gconf_client_get_string(client,gconf_concat_dir_and_key(SEARCH_PREF_PATH, 
	                                       "search_pref_default"), NULL);

	model = search_preferences_get_model();
	gtk_tree_model_foreach (model, on_search_preferences_setting_inactive, NULL);
	
	if (default_pref && (*default_pref != '\0') && g_ascii_strcasecmp (default_pref, BASIC))	
		search_preferences_read_setting(gconf_concat_dir_and_key(SEARCH_PREF_PATH, 
		                                default_pref));
	else
	{
		gtk_tree_model_get_iter_first(model, &iter);
		gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
						    PREF_ACTIVE_COLUMN, TRUE, -1);
		search_preferences_setting_by_default();
	}
	
	search_preferences_activate_default(default_pref);
	g_free(default_pref);
}
static GSList *
panel_lockdown_load_disabled_applets (PanelLockdown *lockdown,
                                      GConfClient   *client,
                                      int            listener)
{
        GSList *retval;

        retval = gconf_client_get_list (client,
                                        DISABLED_APPLETS_KEY,
                                        GCONF_VALUE_STRING,
                                        NULL);

        lockdown->listeners [listener] =
                gconf_client_notify_add (client,
                                         DISABLED_APPLETS_KEY,
                                         (GConfClientNotifyFunc) disabled_applets_notify,
                                         lockdown,
                                         NULL, NULL);

        return retval;
}
예제 #23
0
GSList *
gsearchtool_gconf_get_list (const gchar * key,
                            GConfValueType list_type)
{
	GConfClient * client;
	GError * error = NULL;
	GSList * result;

	g_return_val_if_fail (key != NULL, FALSE);

	client = gsearchtool_gconf_client_get_global ();
	g_return_val_if_fail (client != NULL, NULL);

	result = gconf_client_get_list (client, key, list_type, &error);

	if (gsearchtool_gconf_handle_error (&error)) {
		result = NULL;
	}

	return result;
}
void
gsd_load_modmap_files (void)
{
        GConfClient *client;
        GSList      *tmp = NULL;
        GSList      *loaded_file_list;

        client = gconf_client_get_default ();

        loaded_file_list = gconf_client_get_list (client, LOADED_FILES_KEY, GCONF_VALUE_STRING, NULL);
        tmp = loaded_file_list;
        while (tmp != NULL) {
                gchar *command = NULL;
                command = g_strdup_printf ("xmodmap %s", g_build_filename (g_get_home_dir (), (gchar *)tmp->data, NULL));
                g_spawn_command_line_async (command, NULL);
                tmp = tmp->next;
                g_free (command);
        }

        g_object_unref (client);
}
예제 #25
0
GSList *preferences_get_list (const char *key, PreferencesValue val)
{
        GError *err;
        GSList *list;
        int gval;

        switch (val) {
                case PREFERENCES_VALUE_INT:
                        gval = GCONF_VALUE_INT;
                        break;

                case PREFERENCES_VALUE_STRING:
                        gval = GCONF_VALUE_STRING;
                        break;
        }

        err = NULL;
        list = gconf_client_get_list (warlock_gconf_client, key, gval, &err);
        print_gconf_error (err, key);

        return list;
}
예제 #26
0
GSList *
gnc_gconf_get_list (const gchar *section,
                    const gchar *name,
                    GConfValueType list_type,
                    GError **caller_error)
{
    GError *error = NULL;
    GSList *value;
    gchar *key;

    if (our_client == NULL)
        our_client = gconf_client_get_default();

    key = gnc_gconf_make_key(section, name);
    value = gconf_client_get_list(our_client, key, list_type, &error);
    if (error)
    {
        gnc_gconf_load_error(key, caller_error, error);
    }
    g_free(key);
    return value;
}
예제 #27
0
/**
 * panel_applet_gconf_get_list:
 * @applet: a #PanelApplet.
 * @key: a GConf key name.
 * @error: a #GError, or %NULL.
 *
 * Convenience wrapper around gconf_client_get_list() to get the value of @key
 * in the per-instance GConf directory of @applet.
 *
 * Returns: the value of @key. The list and its content should be freed by the
 * caller.
 *
 * Deprecated: 3.0: Use #GSettings to store per-instance settings.
 **/
GSList *
panel_applet_gconf_get_list (PanelApplet     *applet,
			     const gchar     *key,
			     GConfValueType   list_type,
			     GError         **error)
{
	GConfClient  *client;
	gchar        *full_key;
	GSList       *retval;

	g_return_val_if_fail (PANEL_IS_APPLET (applet), NULL);

	full_key = panel_applet_gconf_get_full_key (applet, key);

	client = panel_applet_gconf_get_client ();

	retval = gconf_client_get_list (client, full_key, list_type, error);

	g_free (full_key);

	return retval;
}
예제 #28
0
static void
gconf_jh_headers_changed (GConfClient *client,
                          guint cnxn_id,
                          GConfEntry *entry,
                          EMailSession *session)
{
	GSList *node;
	GPtrArray *name, *value;

	g_slist_foreach (config->jh_header, (GFunc) g_free, NULL);
	g_slist_free (config->jh_header);

	config->jh_header = gconf_client_get_list (
		client, "/apps/evolution/mail/junk/custom_header",
		GCONF_VALUE_STRING, NULL);

	node = config->jh_header;
	name = g_ptr_array_new ();
	value = g_ptr_array_new ();
	while (node && node->data) {
		gchar **tok = g_strsplit (node->data, "=", 2);
		g_ptr_array_add (name, g_strdup (tok[0]));
		g_ptr_array_add (value, g_strdup (tok[1]));
		node = node->next;
		g_strfreev (tok);
	}
	camel_session_set_junk_headers (
		CAMEL_SESSION (session),
		(const gchar **) name->pdata,
		(const gchar **) value->pdata, name->len);

	g_ptr_array_foreach (name, (GFunc) g_free, NULL);
	g_ptr_array_foreach (value, (GFunc) g_free, NULL);
	g_ptr_array_free (name, TRUE);
	g_ptr_array_free (value, TRUE);
}
예제 #29
0
static void
alarm_del (MnpAlarmItem *item)
{
  GSList *list, *tmp, *del_node;
  GConfClient *client;

  client = gconf_client_get_default();

  list = gconf_client_get_list (client,"/apps/date-time-panel/alarms", GCONF_VALUE_STRING, NULL);
  tmp = list;
  while(tmp) {
	char *data = (char *)tmp->data;
	int id, on_off, hour, min, am_pm, recur, snooze, sound;

	sscanf(data, "%d %d %d %d %d %d %d %d", &id, &on_off, &hour, &min, &am_pm, &recur, &snooze, &sound);

	if (id == item->id) {
		del_node = tmp;
		break;
	}
		
  	tmp = tmp->next;
  }

  if (del_node) {
  	list = g_slist_remove_link (list, del_node);
  	gconf_client_set_list(client,"/apps/date-time-panel/alarms", GCONF_VALUE_STRING, list, NULL);	
	g_free (del_node->data);
	g_slist_free_1 (del_node);
  }

  g_slist_foreach(list, (GFunc)g_free, NULL);
  g_slist_free(list);

  g_object_unref(client);
}
예제 #30
0
static void
dbus_migration_remove_autoload (void)
{
	GConfClient *client;
	GSList *enabled_plugins, *l;

	client = gconf_client_get_default ();
	enabled_plugins = gconf_client_get_list (client, "/apps/xchat/plugins/loaded", GCONF_VALUE_STRING, NULL);

	l = enabled_plugins;
	while (l != NULL) {
		if (g_str_has_suffix (l->data, "dbus.so")) {
			/* Remove the dbus plugin from the autoload list */
			GSList *tmp = l->next;
			enabled_plugins = g_slist_delete_link (enabled_plugins, l);
			l = tmp;
		} else {
			l = l->next;
		}
	}
	gconf_client_set_list (client, "/apps/xchat/plugins/loaded", GCONF_VALUE_STRING, enabled_plugins, NULL);

	g_object_unref (client);
}