[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

vectors with gnome-config



Hi,

Since there is no gnome-app-devel-list (if there is one please lety me
know!) I'll ask it here. I want to store a list of structs, so using vectors
seems to be the best option:

	GList *tmplist=NULL;
	gint count=0;
	Thostinfo *host;
	tmplist = g_list_first(main_v.hostlist);
	
	while(tmplist) {
		const gchar *hostv[7];
		gchar *path;
		host = (Thostinfo *)tmplist->data;
		path = g_strdup_printf("/xsf/Hostlist/%d", count);
		hostv[0] = host->hostname;
		hostv[1] = host->port; 
		hostv[2] = host->name;
		hostv[3] = host->email;
		hostv[4] = host->telephone;
		hostv[5] = host->location;
		hostv[6] = NULL;
		gnome_config_set_vector(path, 6, hostv);
		g_free(path);
		tmplist = g_list_next(tmplist);
	}

but this segfaults, what is the problem with this piece of code and how
should I fix it?

thanks,
	Olivier
-- 
begin signature_virus.TXT.vbs
Hi, I'm a signature virus. plz set me as your signature and help me
spread :)
end





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]