Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Maemo: Developers

How to override load_desktop_file in hildon home plugins?

 

 

Maemo developers RSS feed   Index | Next | Previous | View Threaded


vivainio at gmail

Feb 9, 2010, 9:56 PM

Post #1 of 4 (515 views)
Permalink
How to override load_desktop_file in hildon home plugins?

I need to hook into load_desktop_file for my own plugin, in order
to read some custom keys there (I'm basically using a single .so file
to provide the code, and configure the functionality in desktop files).

Currently, I have a hack that seems to "work", but it fails when plugin
is loaded, unloaded and loaded once more. The hack in question is:

...

G_DEFINE_DYNAMIC_TYPE_EXTENDED (ProxyHomePlugin, proxy_home_plugin,
HD_TYPE_HOME_PLUGIN_ITEM, 0,
G_IMPLEMENT_INTERFACE (HD_TYPE_PLUGIN_ITEM,

proxy_home_plugin_item_init_plugin_item));

HD_PLUGIN_MODULE_SYMBOLS_CODE (proxy_home_plugin, {}, {});

...

static void
proxy_home_plugin_item_init_plugin_item (HDPluginItemIface *iface)
{
iface->load_desktop_file = proxy_home_plugin_item_load_desktop_file;

return;
}


Note that I'm using this instead of the standard

HD_DEFINE_PLUGIN_MODULE (ExampleHomeApplet, example_home_applet,
HD_TYPE_HOME_PLUGIN_ITEM);

(As I understand it, using this wouldn't allow me to override
load_dekstop_file).

This way, my proxy_home_plugin_item_load_desktop_file() function gets
called. But indeed it
appears this is not working fine for unloading & loading.

Is there another way to get at HDPluginItemIface from my
HDHomePluginItem subclass?

--
Ville M. Vainio
http://tinyurl.com/vainio
_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers


vivainio at gmail

Feb 9, 2010, 10:15 PM

Post #2 of 4 (513 views)
Permalink
Re: How to override load_desktop_file in hildon home plugins? [In reply to]

On Wed, Feb 10, 2010 at 7:56 AM, Ville M. Vainio <vivainio [at] gmail> wrote:

> This way, my proxy_home_plugin_item_load_desktop_file() function gets
> called. But indeed it
> appears this is not working fine for unloading & loading.

More details (from looking at the crash in hildon-home):

6319]: GLIB WARNING ** GLib-GObject - cannot add interface type
`HDPluginItem' to type `Pr
oxyHomePlugin', since type `ProxyHomePlugin' already conforms to interface

Program received signal SIGSEGV, Segmentation fault.

Backtrace:


#0 0x00e41fd0 in ?? ()
#1 0x00b3e193 in type_iface_vtable_iface_init_Wm (iface=0x80a41a0,
node=<value optimized o
ut>) at /home/bifh6/fremantle-i386-prereleased.cs2007q3/work/glib2.0-2.20.3/gobject/gtype.c
:1827
#2 0x00b421fd in IA__g_type_class_ref (type=135958760) at
/home/bifh6/fremantle-i386-prere
leased.cs2007q3/work/glib2.0-2.20.3/gobject/gtype.c:2015
#3 0x00b26e84 in IA__g_object_new_valist (object_type=135958760,
first_property_name=0x378
707 "plugin-id", var_args=0xbfffebd8 "8\266\32\b") at
/home/bifh6/fremantle-i386-prerelease
d.cs2007q3/work/glib2.0-2.20.3/gobject/gobject.c:1280
#4 0x00b271c7 in IA__g_object_new (object_type=135958760,
first_property_name=0x378707 "pl
ugin-id") at /home/bifh6/fremantle-i386-prereleased.cs2007q3/work/glib2.0-2.20.3/gobject/go
bject.c:1060
#5 0x00371725 in hd_plugin_module_new_object (module=0x8283008,
plugin_id=0x81ab638 "proxy
-home-widget.desktop-0") at hd-plugin-module.c:247
#6 0x0036e649 in hd_plugin_loader_default_open_module
(loader=0x8287480, plugin_id=0x81ab6
38 "proxy-home-widget.desktop-0", keyfile=0x8275d40, error=0xbfffec6c)
at hd-plugin-loader-
default.c:105
#7 0x0036e79d in hd_plugin_loader_default_load (loader=0x8287480,
plugin_id=0x81ab638 "pro
xy-home-widget.desktop-0", keyfile=0x8275d40, error=0xbfffecbc) at
hd-plugin-loader-default
.c:141
#8 0x0036f3de in hd_plugin_loader_load (loader=0x8287480,
plugin_id=0x81ab638 "proxy-home-
widget.desktop-0", keyfile=0x8275d40, error=0xbfffecbc) at hd-plugin-loader.c:57
#9 0x0036f244 in hd_plugin_loader_factory_create (factory=0x8063e00,
plugin_id=0x81ab638 "
proxy-home-widget.desktop-0", module_id=0x8288888
"/usr/share/applications/hildon-home/prox
y-home-widget.desktop", error=0xbfffed10) at hd-plugin-loader-factory.c:321
#10 0x0036f804 in load_plugin_idle (idle_data=0x819c550) at
hd-plugin-manager.c:235
#11 0x003b486c in gdk_threads_dispatch (data=0x81b3970) at gdk.c:473
#12 0x0027b0e3 in g_idle_dispatch (source=0x82770a0,
callback=0x817db38, user_data=0x81b397
0) at /home/bifh6/fremantle-i386-prereleased.cs2007q3/work/glib2.0-2.20.3/glib/gmain.c:3966
#13 0x0027ce3c in IA__g_main_context_dispatch (context=0x8071888) at
/home/bifh6/fremantle-
i386-prereleased.cs2007q3/work/glib2.0-2.20.3/glib/gmain.c:1836
#14 0x002803c5 in g_main_context_iterate (context=0x8071888, block=1,
dispatch=1, self=0x80
55ac0) at /home/bifh6/fremantle-i386-prereleased.cs2007q3/work/glib2.0-2.20.3/glib/gmain.c:
2467
#15 0x002806b8 in IA__g_main_loop_run (loop=0x819dbf0) at
/home/bifh6/fremantle-i386-prerel
eased.cs2007q3/work/glib2.0-2.20.3/glib/gmain.c:2675
#16 0x01013eb9 in IA__gtk_main () at gtkmain.c:1200
#17 0x0039a726 in main (argc=134691256, argv=0x9) at hildon-home.c:199
#18 0x08048983 in summon_process (prog=0xbfffef6c) at summoner.c:43
#19 0x08048c2a in main (argc=2, argv=0xbffff054) at summoner.c:128
--
Ville M. Vainio
http://tinyurl.com/vainio
_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers


g+770 at cobb

Feb 10, 2010, 1:51 AM

Post #3 of 4 (508 views)
Permalink
Re: How to override load_desktop_file in hildon home plugins? [In reply to]

On Wednesday 10 February 2010 06:15:02 Ville M. Vainio wrote:
> On Wed, Feb 10, 2010 at 7:56 AM, Ville M. Vainio <vivainio [at] gmail> wrote:
> > This way, my proxy_home_plugin_item_load_desktop_file() function gets
> > called. But indeed it
> > appears this is not working fine for unloading & loading.
>
> More details (from looking at the crash in hildon-home):
>
> 6319]: GLIB WARNING ** GLib-GObject - cannot add interface type
> `HDPluginItem' to type `Pr
> oxyHomePlugin', since type `ProxyHomePlugin' already conforms to interface

Are you sure that your dynamic type is being completely destroyed when you
unload? I don't remember the details but I did spend some time trying to get
a plugin with a dynamic type to handle unloading and reloading and eventually
convinced myself it was impossible and decided just to prevent unloading
instead.

I don't know much about GType but it seems that even dynamic types are not
designed to support unloading code.

Graham
_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers


vivainio at gmail

Feb 10, 2010, 3:06 AM

Post #4 of 4 (509 views)
Permalink
Re: How to override load_desktop_file in hildon home plugins? [In reply to]

On Wed, Feb 10, 2010 at 11:51 AM, Graham Cobb <g+770 [at] cobb> wrote:

> Are you sure that your dynamic type is being completely destroyed when you
> unload?  I don't remember the details but I did spend some time trying to get

Apparently, it is.

> a plugin with a dynamic type to handle unloading and reloading and eventually
> convinced myself it was impossible and decided just to prevent unloading
> instead.

Thanks, while debugging to see whether this is the case I noticed a
memory corruption of my own doing (undetected by valgrind), which
seems to stop the crashing and warnings :-).

--
Ville M. Vainio
http://tinyurl.com/vainio
_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers

Maemo developers RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.