From: Enlightenment S. <no-...@en...> - 2011-01-12 01:44:15
|
Log: okay, so to check for udisks I've done the following: 1) set a signal handler to watch for udisks starting 2) check for udisks already running 3) send dbus method call to udisks regardless of run state 4) free error which is 100% guaranteed to occur 5) either pick up udisks from signal handler or from random dbus call 6) finally start efm 7) drink heavily. Author: discomfitor Date: 2011-01-11 17:44:08 -0800 (Tue, 11 Jan 2011) New Revision: 56055 Trac: http://trac.enlightenment.org/e/changeset/56055 Modified: trunk/e/src/bin/e_fm/e_fm_main_udisks.c Modified: trunk/e/src/bin/e_fm/e_fm_main_udisks.c =================================================================== --- trunk/e/src/bin/e_fm/e_fm_main_udisks.c 2011-01-11 23:38:42 UTC (rev 56054) +++ trunk/e/src/bin/e_fm/e_fm_main_udisks.c 2011-01-12 01:44:08 UTC (rev 56055) @@ -936,8 +936,9 @@ E_DBUS_FDO_INTERFACE, "NameOwnerChanged", _e_fm_main_udisks_poll, NULL); - msg = dbus_message_new_method_call(E_UDISKS_BUS, E_UDISKS_PATH, E_UDISKS_BUS, NULL); - e_dbus_method_call_send(_e_fm_main_udisks_conn, msg, NULL, (E_DBus_Callback_Func)_e_fm_main_udisks_test, NULL, -1, NULL); + e_dbus_get_name_owner(_e_fm_main_udisks_conn, E_UDISKS_BUS, _e_fm_main_udisks_test, NULL); /* test for already running udisks */ + msg = dbus_message_new_method_call(E_UDISKS_BUS, E_UDISKS_PATH, E_UDISKS_BUS, "suuuuuup"); + e_dbus_method_call_send(_e_fm_main_udisks_conn, msg, NULL, (E_DBus_Callback_Func)_e_fm_main_udisks_test, NULL, -1, NULL); /* test for not running udisks */ dbus_message_unref(msg); } |