Using g_object_get_data() in a NautilusMenuItem callback



Could someone let me know if this is the right way to use g_object_get_data() in my callback function in my NautilusMenuItem implementation? Something I'm doing isn't working quite right and it's causing Nautilus to crash when I select this item from the context menu.

The entire code can be found in this file: http://forge.novell.com/modules/xfmod/cvs/cvsbrowse.php/ifolder/ nautilus-ifolder/src/nautilus-ifolder.c?rev=1.1&content-type=text/ vnd.viewcvs-markup

Here is where I think the problem might begin:

static void
create_ifolder_callback (NautilusMenuItem *item, gpointer user_data)
{
	g_print ("Convert to iFolder selected\n");	
	NautilusFileInfo *file;
	gint error;
file = NAUTILUS_FILE_INFO (g_object_get_data (G_OBJECT (item), "files"));
//	file = (NautilusFileInfo *)user_data;
	if (file == NULL)
		return;

	error = create_local_ifolder (file);
	if (error) {
		/* FIXME: Figure out how to let the user know an error happened */
		g_print ("An error occurred creating an iFolder\n");
	}
}

-Boyd




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