static void __bt_obex_agent_unregister(obex_server_info_t *obex_server_info)
{
	GError *error = NULL;
	DBG("\n");

	dbus_g_proxy_call(obex_server_info->obex_proxy, "UnregisterAgent", &error,
			  DBUS_TYPE_G_OBJECT_PATH, OBEX_SERVER_AGENT_PATH,
			  G_TYPE_INVALID, G_TYPE_INVALID);
	if (error != NULL) {
		DBG("Agent unregistration failed: %s\n", error->message);
		g_error_free(error);
	}

	dbus_g_proxy_disconnect_signal(obex_server_info->obex_proxy,
				    "TransferStarted",
				    G_CALLBACK(__bt_transfer_started_cb),
				    obex_server_info);

	dbus_g_proxy_disconnect_signal(obex_server_info->obex_proxy,
				    "TransferCompleted",
				    G_CALLBACK(__bt_transfer_completed_cb),
				    obex_server_info);

	if (obex_server_info->bus) {
		dbus_g_connection_unref(obex_server_info->bus);
		obex_server_info->bus = NULL;
	}

	g_object_unref(obex_server_info->obex_proxy);
	obex_server_info->obex_proxy = NULL;

	g_object_unref(obex_server_info->obex_server_agent);
	obex_server_info->obex_server_agent = NULL;
}
static void
modem_free (Modem *modem)
{
	GList *netops;

	g_free (modem->cid);
	g_free (modem->lac);

	if (modem->netreg_proxy) {
		dbus_g_proxy_disconnect_signal (modem->netreg_proxy, "PropertyChanged",
		                                G_CALLBACK (netreg_property_changed_cb),
		                                modem);
		g_object_unref (modem->netreg_proxy);
	}

	if (modem->proxy) {
		dbus_g_proxy_disconnect_signal (modem->proxy, "PropertyChanged",
		                                G_CALLBACK (modem_property_changed_cb),
		                                modem);
		g_object_unref (modem->proxy);
	}

	for (netops = modem->netops; netops; netops = netops->next) {
		net_op_free ((NetOp*)netops->data);
	}
	g_list_free (modem->netops);

	g_slice_free (Modem, modem);
}
void _bluetooth_network_server_remove_signal(void)
{
	DBG("+\n");

	bt_info_t *bt_internal_info = NULL;

	bt_internal_info = _bluetooth_internal_get_information();

	if (bt_internal_info->network_server_proxy == NULL) {
		DBG("No network proxy exist");
		return;
	}

	/* Remove the network server signal */
	dbus_g_proxy_disconnect_signal(bt_internal_info->network_server_proxy, "PeerConnected",
				       G_CALLBACK(__bluetooth_network_server_connected), NULL);

	dbus_g_proxy_disconnect_signal(bt_internal_info->network_server_proxy, "PeerDisconnected",
				       G_CALLBACK(__bluetooth_network_server_disconnected), NULL);

	g_object_unref(bt_internal_info->network_server_proxy);

	bt_internal_info->network_server_proxy = NULL;

	DBG("-\n");
}
void 
rhythmbox_dbus_disconnect_from_bus (void) 
{
    if (dbus_proxy_player != NULL) 
    {
        dbus_g_proxy_disconnect_signal(dbus_proxy_player, "playingChanged",
            G_CALLBACK(rb_onChangeState), NULL);
        cid_debug ("playingChanged deconnecte\n");
        
        dbus_g_proxy_disconnect_signal(dbus_proxy_player, "playingUriChanged",
            G_CALLBACK(rb_onChangeSong), NULL);
        cid_debug ("playingUriChanged deconnecte\n");
        
        dbus_g_proxy_disconnect_signal(dbus_proxy_player, "elapsedChanged",
            G_CALLBACK(rb_onElapsedChanged), NULL);
        cid_debug ("elapsedChanged deconnecte\n");
        
        dbus_g_proxy_disconnect_signal(dbus_proxy_player, "rb:CovertArt-uri",
            G_CALLBACK(rb_onCovertArtChanged), NULL);
        cid_debug ("onCovertArtChanged deconnecte\n");
        
        g_object_unref (dbus_proxy_player);
        dbus_proxy_player = NULL;
    }
    if (dbus_proxy_shell != NULL) 
    {
        g_object_unref (dbus_proxy_shell);
        dbus_proxy_shell = NULL;
    }
}
static void
modem_sms_service_disconnect (ModemOface *_self)
{
  DEBUG ("(%p): enter", _self);

  ModemSMSService *self = MODEM_SMS_SERVICE (_self);
  ModemSMSServicePrivate *priv = self->priv;
  DBusGProxy *proxy = modem_oface_dbus_proxy (_self);

  if (priv->signals)
    {
      priv->signals = FALSE;

      dbus_g_proxy_disconnect_signal (proxy, "IncomingMessage",
          G_CALLBACK (on_immediate_message), self);
      dbus_g_proxy_disconnect_signal (proxy, "ImmediateMessage",
          G_CALLBACK (on_incoming_message), self);
      dbus_g_proxy_disconnect_signal (proxy, "MessageAdded",
          G_CALLBACK (on_manager_message_added), self);
      dbus_g_proxy_disconnect_signal (proxy, "MessageRemoved",
          G_CALLBACK (on_manager_message_removed), self);
    }

#if nomore
  g_hash_table_remove_all (priv->received);
#endif

  modem_oface_disconnect_properties (_self);
}
Esempio n. 6
0
static void device_remove_cb(RoccatConfigWindow *roccat_window, gpointer user_data) {
	IskuconfigWindow *window = ISKUCONFIG_WINDOW(roccat_window);
	IskuconfigWindowPrivate *priv = window->priv;

	dbus_g_proxy_disconnect_signal(priv->dbus_proxy, "ProfileChanged", G_CALLBACK(actual_profile_changed_from_device_cb), window);
	dbus_g_proxy_disconnect_signal(priv->dbus_proxy, "BrightnessChanged", G_CALLBACK(brightness_changed_from_device_cb), window);
	dbus_g_proxy_disconnect_signal(priv->dbus_proxy, "MacroChanged", G_CALLBACK(macro_changed_from_device_cb), window);
}
Esempio n. 7
0
/**
 * Disconnects from manager signals
 */
static void disconnect_manager_signals()
{
	dbus_g_proxy_disconnect_signal(manager, "AdapterAdded",
				       G_CALLBACK(adapter_added),
				       NULL);

	dbus_g_proxy_disconnect_signal(manager, "AdapterRemoved",
				       G_CALLBACK(adapter_removed),
				       NULL);
}
Esempio n. 8
0
static void g_udisks_volume_monitor_finalize(GObject *object)
{
    GUDisksVolumeMonitor *self;

    g_return_if_fail(object != NULL);
    g_return_if_fail(G_IS_UDISKS_VOLUME_MONITOR(object));

    self = G_UDISKS_VOLUME_MONITOR(object);

    if(self->idle_handler)
    {
        GList* l;
        g_source_remove(self->idle_handler);
        for(l = self->queued_events; l; l=l->next)
        {
            QueuedEvent* q = (QueuedEvent*)l->data;
            g_object_unref(q->dev);
            g_slice_free(QueuedEvent, q);
        }
        g_list_free(self->queued_events);
    }

    if(self->udisks_proxy)
    {
        dbus_g_proxy_disconnect_signal(self->udisks_proxy, "DeviceAdded", G_CALLBACK(on_device_added), self);
        dbus_g_proxy_disconnect_signal(self->udisks_proxy, "DeviceRemoved", G_CALLBACK(on_device_removed), self);
        dbus_g_proxy_disconnect_signal(self->udisks_proxy, "DeviceChanged", G_CALLBACK(on_device_changed), self);
        g_object_unref(self->udisks_proxy);
    }

    if(self->devices)
    {
        g_list_foreach(self->devices, (GFunc)g_object_unref, NULL);
        g_list_free(self->devices);
    }

    if(self->drives)
    {
        g_list_foreach(self->drives, (GFunc)g_object_unref, NULL);
        g_list_free(self->drives);
    }

    if(self->volumes)
    {
        g_list_foreach(self->volumes, (GFunc)g_object_unref, NULL);
        g_list_free(self->volumes);
    }

    G_OBJECT_CLASS(g_udisks_volume_monitor_parent_class)->finalize(object);
}
static void
mnb_panel_oop_dispose (GObject *self)
{
  MnbPanelOopPrivate *priv   = MNB_PANEL_OOP (self)->priv;
  DBusGProxy         *proxy  = priv->proxy;

  if (proxy)
    {
      dbus_g_proxy_disconnect_signal (proxy, "RequestFocus",
                                   G_CALLBACK (mnb_panel_oop_request_focus_cb),
                                   self);

      dbus_g_proxy_disconnect_signal (proxy, "RequestButtonStyle",
                             G_CALLBACK (mnb_panel_oop_request_button_style_cb),
                             self);

      dbus_g_proxy_disconnect_signal (proxy, "RequestButtonState",
                             G_CALLBACK (mnb_panel_oop_request_button_state_cb),
                             self);

      dbus_g_proxy_disconnect_signal (proxy, "RequestModality",
                             G_CALLBACK (mnb_panel_oop_request_modality_cb),
                             self);

      dbus_g_proxy_disconnect_signal (proxy, "RequestTooltip",
                                  G_CALLBACK (mnb_panel_oop_request_tooltip_cb),
                                  self);
      g_object_unref (proxy);
      priv->proxy = NULL;
    }

  if (priv->proxy_for_owner)
    g_object_weak_unref (G_OBJECT (priv->proxy_for_owner),
                         mnb_panel_oop_dbus_proxy_weak_notify_cb, self);

  if (priv->dbus_conn)
    {
      dbus_g_connection_unref (priv->dbus_conn);
      priv->dbus_conn = NULL;
    }

  if (priv->button)
    {
      priv->button = NULL;
    }

  g_signal_emit (self, signals[DESTROY], 0);

  G_OBJECT_CLASS (mnb_panel_oop_parent_class)->dispose (self);
}
Esempio n. 10
0
static void _cd_disconnect_from_resuming_signal (GldiModuleInstance *myApplet)
{
	if (myData.pProxyResuming)
	{
		if (s_bUsedLogind)
			dbus_g_proxy_disconnect_signal (myData.pProxyResuming, "PrepareForSleep",
				G_CALLBACK (_on_prepare_for_sleep), myApplet);
		else
			dbus_g_proxy_disconnect_signal (myData.pProxyResuming, "Resuming",
				G_CALLBACK (_on_resuming), myApplet);

		g_object_unref (myData.pProxyResuming);
	}
}
static void
set_state (NMSupplicantInterface *self, guint32 new_state)
{
	NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
	guint32 old_state = priv->state;

	g_return_if_fail (new_state < NM_SUPPLICANT_INTERFACE_STATE_LAST);

	if (new_state == priv->state)
		return;

	/* DOWN is a terminal state */
	g_return_if_fail (priv->state != NM_SUPPLICANT_INTERFACE_STATE_DOWN);

	/* Cannot regress to READY, STARTING, or INIT from higher states */
	if (priv->state >= NM_SUPPLICANT_INTERFACE_STATE_READY)
		g_return_if_fail (new_state > NM_SUPPLICANT_INTERFACE_STATE_READY);

	if (new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) {
		/* Cancel all pending calls when going down */
		cancel_all_callbacks (priv->other_pcalls);
		cancel_all_callbacks (priv->assoc_pcalls);

		/* Disconnect supplicant manager state listeners since we're done */
		if (priv->smgr_avail_id) {
			g_signal_handler_disconnect (priv->smgr, priv->smgr_avail_id);
			priv->smgr_avail_id = 0;
		}

		if (priv->iface_proxy) {
			dbus_g_proxy_disconnect_signal (priv->iface_proxy,
			                                "PropertiesChanged",
			                                G_CALLBACK (wpas_iface_properties_changed),
			                                self);
			dbus_g_proxy_disconnect_signal (priv->iface_proxy,
			                                "ScanDone",
			                                G_CALLBACK (wpas_iface_scan_done),
			                                self);
			dbus_g_proxy_disconnect_signal (priv->iface_proxy,
			                                "BSSAdded",
			                                G_CALLBACK (wpas_iface_bss_added),
			                                self);
		}
	}

	priv->state = new_state;
	g_signal_emit (self, signals[STATE], 0, priv->state, old_state);
}
static void
connectivity_finalize (GObject *object)
{
#ifdef HAVE_NM
  EmpathyConnectivity *connectivity = EMPATHY_CONNECTIVITY (object);
  EmpathyConnectivityPriv *priv = GET_PRIV (connectivity);

  if (priv->nm_client != NULL)
    {
      g_signal_handler_disconnect (priv->nm_client,
          priv->state_change_signal_id);
      priv->state_change_signal_id = 0;
      g_object_unref (priv->nm_client);
      priv->nm_client = NULL;
    }
#endif

#ifdef HAVE_CONNMAN
  EmpathyConnectivity *connectivity = EMPATHY_CONNECTIVITY (object);
  EmpathyConnectivityPriv *priv = GET_PRIV (connectivity);

  if (priv->proxy != NULL)
    {
      dbus_g_proxy_disconnect_signal (priv->proxy, "StateChanged",
          G_CALLBACK (connectivity_connman_state_changed_cb), connectivity);

      g_object_unref (priv->proxy);
      priv->proxy = NULL;
    }
#endif

  G_OBJECT_CLASS (empathy_connectivity_parent_class)->finalize (object);
}
void cd_NetworkMonitor_get_new_access_point (void)
{
	myData.iQuality = WIFI_QUALITY_NO_SIGNAL;
	if (myData.cAccessPoint != NULL)
	{
		cd_debug (" on recupere le nouveau point d'acces...\n");
		if (myData.dbus_proxy_ActiveAccessPoint)
		{
			dbus_g_proxy_disconnect_signal(myData.dbus_proxy_ActiveAccessPoint, "PropertiesChanged",
				G_CALLBACK(onChangeAccessPointProperties), NULL);
			g_object_unref (myData.dbus_proxy_ActiveAccessPoint);
		}
		if (myData.dbus_proxy_ActiveAccessPoint_prop)
		{
			g_object_unref (myData.dbus_proxy_ActiveAccessPoint_prop);
		}
		
		myData.dbus_proxy_ActiveAccessPoint_prop = cairo_dock_create_new_system_proxy (
			"org.freedesktop.NetworkManager",
			myData.cAccessPoint,
			"org.freedesktop.DBus.Properties");
		myData.dbus_proxy_ActiveAccessPoint = cairo_dock_create_new_system_proxy (
			"org.freedesktop.NetworkManager",
			myData.cAccessPoint,
			"org.freedesktop.NetworkManager.AccessPoint");
		dbus_g_proxy_add_signal(myData.dbus_proxy_ActiveAccessPoint, "PropertiesChanged", CD_DBUS_TYPE_HASH_TABLE, G_TYPE_INVALID);
		dbus_g_proxy_connect_signal(myData.dbus_proxy_ActiveAccessPoint, "PropertiesChanged",
			G_CALLBACK(onChangeAccessPointProperties), NULL, NULL);
		
		cd_NetworkMonitor_get_access_point_properties ();
	}
}
Esempio n. 14
0
static void
dun_cleanup (PluginInfo *info, const char *message, gboolean uncheck)
{
	GSList *iter;

	for (iter = info->modem_proxies; iter; iter = g_slist_next (iter))
		g_object_unref (DBUS_G_PROXY (iter->data));
	g_slist_free (info->modem_proxies);
	info->modem_proxies = NULL;

	if (info->dun_proxy) {
		if (info->rfcomm_iface) {
			dbus_g_proxy_call_no_reply (info->dun_proxy, "Disconnect",
			                            G_TYPE_STRING, info->rfcomm_iface,
			                            G_TYPE_INVALID);
		}

		dbus_g_proxy_disconnect_signal (info->dun_proxy, "PropertyChanged",
		                                G_CALLBACK (dun_property_changed), info);

		g_object_unref (info->dun_proxy);
		info->dun_proxy = NULL;
	}

	g_free (info->rfcomm_iface);
	info->rfcomm_iface = NULL;

	if (info->bus) {
		dbus_g_connection_unref (info->bus);
		info->bus = NULL;
	}

	if (info->dun_timeout_id) {
		g_source_remove (info->dun_timeout_id);
		info->dun_timeout_id = 0;
	}

	if (info->window_group) {
		g_object_unref (info->window_group);
		info->window_group = NULL;
	}

	if (info->wizard) {
		mobile_wizard_destroy (info->wizard);
		info->wizard = NULL;
	}

	if (info->spinner) {
		nma_bling_spinner_stop (BMA_BLING_SPINNER (info->spinner));
		gtk_widget_hide (info->spinner);
	}
	gtk_label_set_text (GTK_LABEL (info->label), message);
	gtk_widget_set_sensitive (info->dun_button, TRUE);

	if (uncheck) {
		g_signal_handler_block (info->dun_button, info->dun_toggled_id);
		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->dun_button), FALSE);
		g_signal_handler_unblock (info->dun_button, info->dun_toggled_id);
	}
}
static void
geoclue_gsmloc_ofono_dispose (GObject *obj)
{
	GeoclueGsmlocOfono *ofono = GEOCLUE_GSMLOC_OFONO (obj);
	GeoclueGsmlocOfonoPrivate *priv = GET_PRIVATE (ofono);
	GList *mlist;

	if (priv->ofono_manager) {
		dbus_g_proxy_disconnect_signal (priv->ofono_manager, "PropertyChanged",
		                                G_CALLBACK (manager_property_changed_cb),
		                                ofono);
		g_object_unref (priv->ofono_manager);
		priv->ofono_manager = NULL;
	}

	if (priv->modems) {
		for (mlist = priv->modems; mlist; mlist = mlist->next) {
			modem_free ((Modem*)mlist->data);
		}
		g_list_free (priv->modems);
		priv->modems = NULL;
	}

	((GObjectClass *) geoclue_gsmloc_ofono_parent_class)->dispose (obj);
}
static void __bt_obex_server_transfer_free(transfer_info_t *transfer_info)
{
	DBG("+");

	if (transfer_info == NULL)
		return;

	if (transfer_info->transfer_proxy) {
		dbus_g_proxy_disconnect_signal(transfer_info->transfer_proxy,
				       "Progress",
				       G_CALLBACK(__bt_transfer_progress_cb),
				       transfer_info);

			g_object_unref(transfer_info->transfer_proxy);
			transfer_info->transfer_proxy = NULL;
	}

	g_free(transfer_info->path);
	g_free(transfer_info->filename);
	g_free(transfer_info->type);
	g_free(transfer_info->device_name);
 	g_free(transfer_info);

	DBG("-");
}
Esempio n. 17
0
 ~PlayerProxies()
 {
     dbus_g_proxy_disconnect_signal(
             dbus_service_proxy_, "NameOwnerChanged",
             G_CALLBACK(service_owner_changed), this);
     g_object_unref(dbus_service_proxy_);
     dbus_g_connection_unref(dbus_sess_conn_);
 }
/* Permet de libérer la mémoire prise par notre controleur
 */
void cd_rhythmbox_free_data (void) {
	if (myData.dbus_proxy_player != NULL)
	{
		dbus_g_proxy_disconnect_signal(myData.dbus_proxy_player, "playingChanged",
			G_CALLBACK(onChangePlaying), NULL);
		
		dbus_g_proxy_disconnect_signal(myData.dbus_proxy_player, "playingUriChanged",
			G_CALLBACK(onChangeSong), NULL);
		
		dbus_g_proxy_disconnect_signal(myData.dbus_proxy_player, "elapsedChanged",
			G_CALLBACK(onElapsedChanged), NULL);
		
		dbus_g_proxy_disconnect_signal(myData.dbus_proxy_player, "rb:CovertArt-uri",
			G_CALLBACK(onCoverArtChanged), NULL);
	}
	
	musicplayer_dbus_disconnect_from_bus();
	musicplayer_dbus_disconnect_from_bus_Shell();
}
Esempio n. 19
0
/**
 * Disconnect HealthDevice signals
 */
static gboolean disconnect_device_signals(const char *device_path)
{
	channel_object *c;
	DBusGProxy *proxy = get_device(device_path);
	gboolean dirty;

	if (!device_path)
		return FALSE;

	dbus_g_proxy_disconnect_signal(proxy, "ChannelConnected",
				       G_CALLBACK(channel_connected),
				       NULL);

	dbus_g_proxy_disconnect_signal(proxy, "ChannelDeleted",
				       G_CALLBACK(channel_deleted),
				       NULL);

	DEBUG("Disconnected device %s", device_path);

	// Disconnect channels related to this device
	do {
		dirty = FALSE;
		LinkedNode *i = channels()->first;

		while (i) {
			c = i->element;
		
			if (strcmp(c->device, device_path) == 0) {
				disconnect_channel(c->handle, 0);
				dirty = TRUE;
				break;
			}
			i = i->next;
		}
        
	} while (dirty);

	remove_device(device_path);

	return TRUE;
}
static void
signon_auth_session_dispose (GObject *object)
{
    g_return_if_fail (SIGNON_IS_AUTH_SESSION (object));
    SignonAuthSession *self = SIGNON_AUTH_SESSION (object);
    SignonAuthSessionPrivate *priv = self->priv;
    g_return_if_fail (priv != NULL);

    if (priv->dispose_has_run)
        return;

    GError *err = NULL;

    if (priv->proxy)
    {
        dbus_g_proxy_disconnect_signal (priv->proxy,
                                        "stateChanged",
                                        G_CALLBACK (auth_session_state_changed_cb),
                                        self);
        dbus_g_proxy_disconnect_signal (priv->proxy,
                                        "unregistered",
                                        G_CALLBACK (auth_session_remote_object_destroyed_cb),
                                        self);

        SSO_AuthSession_object_unref (priv->proxy, &err);
        g_object_unref (priv->proxy);

        priv->proxy = NULL;
    }

    if (priv->signon_proxy)
    {
        g_object_unref (priv->signon_proxy);
        priv->signon_proxy = NULL;
    }

    G_OBJECT_CLASS (signon_auth_session_parent_class)->dispose (object);

    priv->dispose_has_run = TRUE;
}
Esempio n. 21
0
/** Disconnect from call service */
static void
modem_call_service_disconnect (ModemOface *_self)
{
  DEBUG ("(%p): enter", _self);

  ModemCallService *self = MODEM_CALL_SERVICE (_self);
  ModemCallServicePrivate *priv = self->priv;
  GHashTableIter iter[1];
  ModemCall *ci;

  while (!g_queue_is_empty (priv->dialing.queue))
    {
      ModemRequest *request = g_queue_pop_head (priv->dialing.queue);
      modem_request_cancel (request);
    }

  if (priv->signals)
    {
      priv->signals = FALSE;

      dbus_g_proxy_disconnect_signal (DBUS_PROXY (self), "CallAdded",
          G_CALLBACK (on_manager_call_added), self);
      dbus_g_proxy_disconnect_signal (DBUS_PROXY (self), "CallRemoved",
          G_CALLBACK (on_manager_call_removed), self);
      dbus_g_proxy_disconnect_signal (DBUS_PROXY (self), "Forwarded",
          G_CALLBACK (on_manager_call_forwarded), self);
    }

  for (g_hash_table_iter_init (iter, priv->instances);
       g_hash_table_iter_next (iter, NULL, (gpointer)&ci);
       g_hash_table_iter_init (iter, priv->instances))
    {
      modem_call_service_disconnect_instance (self, ci);
    }

  ci = priv->conference.instance;
  modem_call_service_disconnect_instance (self, ci);

  modem_oface_disconnect_properties (_self);
}
Esempio n. 22
0
/**
 * Disconnects adapter signals
 */
static void disconnect_adapter(const char *path)
{
	adapter_object *a = get_adapter(path);
	gboolean dirty;
	device_object *d;

	if (!a)
		return;

	DEBUG("Disconnecting adapter: %s", path);

	dbus_g_proxy_disconnect_signal(a->proxy, "DeviceCreated",
				       G_CALLBACK(device_created),
				       NULL);

	dbus_g_proxy_disconnect_signal(a->proxy, "DeviceRemoved",
				       G_CALLBACK(device_removed),
				       NULL);

	// Disconnect devices related to this adapter
	do {
		dirty = FALSE;
		LinkedNode *i = devices()->first;

		while (i) {
			d = i->element;
			if (strcmp(d->adapter, path) == 0) {
				disconnect_device_signals(d->path);
				dirty = TRUE;
				break;
			}
			i = i->next;
		}

	} while (dirty);


	remove_adapter(path);
}
Esempio n. 23
0
static void
cryptui_keyset_dispose (GObject *gobject)
{
    CryptUIKeyset *keyset = CRYPTUI_KEYSET (gobject);
    
    g_hash_table_foreach_remove (keyset->priv->keys, (GHRFunc)remove_update, keyset);
       
    if(keyset->priv->remote_keyset) {
        dbus_g_proxy_disconnect_signal (keyset->priv->remote_keyset, "KeyAdded", 
                                        G_CALLBACK (key_added), keyset);
        dbus_g_proxy_disconnect_signal (keyset->priv->remote_keyset, "KeyRemoved", 
                                        G_CALLBACK (key_removed), keyset);
        dbus_g_proxy_disconnect_signal (keyset->priv->remote_keyset, "KeyChanged", 
                                        G_CALLBACK (key_changed), keyset);
        
        g_object_unref (keyset->priv->remote_keyset);
        keyset->priv->remote_keyset = NULL;
        g_object_unref (keyset->priv->remote_service);
        keyset->priv->remote_service = NULL;
    }
    
    G_OBJECT_CLASS (cryptui_keyset_parent_class)->dispose (gobject);
}
static void
names_model_set_connection (NamesModel      *names_model,
                            DBusGConnection *connection)
{
  g_return_if_fail (IS_NAMES_MODEL (names_model));
  
  if (connection == names_model->connection)
    return;

  if (names_model->connection)
    {
      dbus_g_proxy_disconnect_signal (names_model->driver_proxy,
                                      "NameOwnerChanged",
                                      G_CALLBACK (name_owner_changed),
                                      names_model);
      
      g_object_unref (names_model->driver_proxy);
      names_model->driver_proxy = NULL;
      dbus_g_connection_unref (names_model->connection);
      names_model->connection = NULL;
    }
  
  if (connection)
    {
      names_model->connection = connection;
      dbus_g_connection_ref (names_model->connection);
      
      names_model->driver_proxy =
        dbus_g_proxy_new_for_name (names_model->connection,
                                   DBUS_SERVICE_DBUS,
                                   DBUS_PATH_DBUS,
                                   DBUS_INTERFACE_DBUS);
      g_assert (names_model->driver_proxy);

      dbus_g_proxy_add_signal (names_model->driver_proxy,
                               "NameOwnerChanged",
                               G_TYPE_STRING,
                               G_TYPE_STRING,
                               G_TYPE_STRING,
			       G_TYPE_INVALID);
      
      dbus_g_proxy_connect_signal (names_model->driver_proxy,
                                   "NameOwnerChanged", 
                                   G_CALLBACK (name_owner_changed),
                                   names_model,
                                   NULL);
    }

  names_model_reload (names_model);
}
Esempio n. 25
0
File: verify.c Progetto: dsd/fprintd
static void do_verify(DBusGProxy *dev)
{
	GError *error;
	gboolean verify_completed = FALSE;

	dbus_g_proxy_add_signal(dev, "VerifyStatus", G_TYPE_STRING, G_TYPE_BOOLEAN, NULL);
	dbus_g_proxy_add_signal(dev, "VerifyFingerSelected", G_TYPE_INT, NULL);
	dbus_g_proxy_connect_signal(dev, "VerifyStatus", G_CALLBACK(verify_result),
				    &verify_completed, NULL);
	dbus_g_proxy_connect_signal(dev, "VerifyFingerSelected", G_CALLBACK(verify_finger_selected),
		NULL, NULL);

	if (!net_reactivated_Fprint_Device_verify_start(dev, finger_name, &error))
		g_error("VerifyStart failed: %s", error->message);

	while (!verify_completed)
		g_main_context_iteration(NULL, TRUE);

	dbus_g_proxy_disconnect_signal(dev, "VerifyStatus", G_CALLBACK(verify_result), &verify_completed);
	dbus_g_proxy_disconnect_signal(dev, "VerifyFingerSelected", G_CALLBACK(verify_finger_selected), NULL);

	if (!net_reactivated_Fprint_Device_verify_stop(dev, &error))
		g_error("VerifyStop failed: %s", error->message);
}
static void
net_op_free (NetOp *op)
{
	g_free (op->mcc);
	g_free (op->mnc);

	if (op->proxy) {
		dbus_g_proxy_disconnect_signal (op->proxy, "PropertyChanged",
		                                G_CALLBACK (net_op_property_changed_cb),
		                                op);
		g_object_unref (op->proxy);
	}

	g_slice_free (NetOp, op);
}
Esempio n. 27
0
static void
dispose (GObject *object)
{
	GypsyCoursePrivate *priv;

	priv = GET_PRIVATE (object);

	if (priv->proxy) {
		dbus_g_proxy_disconnect_signal (priv->proxy, "CourseChanged",
						G_CALLBACK (course_changed),
						object);
		g_object_unref (priv->proxy);
		priv->proxy = NULL;
	}

	G_OBJECT_CLASS (gypsy_course_parent_class)->dispose (object);
}
Esempio n. 28
0
void gnome_remote_uninit ()
{
    GError *error = NULL;
    if (media_player_keys_proxy == NULL) return;

    dbus_g_proxy_disconnect_signal (media_player_keys_proxy, "MediaPlayerKeyPressed",
     G_CALLBACK (on_media_player_key_pressed), NULL);

    dbus_g_proxy_call (media_player_keys_proxy,
     "ReleaseMediaPlayerKeys", &error,
     G_TYPE_STRING, "Audacious",
     G_TYPE_INVALID, G_TYPE_INVALID);
    if (error != NULL) {
        g_warning ("Could not release media player keys: %s", error->message);
        g_error_free (error);
    }
    g_object_unref(media_player_keys_proxy);
    media_player_keys_proxy = NULL;
}
static void
modem_set_net_reg (Modem *modem, gboolean net_reg)
{
	GList *netops;

	g_free (modem->cid);
	modem->cid = NULL;
	g_free (modem->lac);
	modem->lac = NULL;

	if (modem->netreg_proxy) {
		dbus_g_proxy_disconnect_signal (modem->netreg_proxy, "PropertyChanged",
		                                G_CALLBACK (netreg_property_changed_cb),
		                                modem);
		g_object_unref (modem->netreg_proxy);
		modem->netreg_proxy = NULL;
	}

	for (netops = modem->netops; netops; netops = netops->next) {
		net_op_free ((NetOp*)netops->data);
	}
	g_list_free (modem->netops);
	modem->netops = NULL;

	if (net_reg) {
		modem->netreg_proxy = dbus_g_proxy_new_from_proxy (modem->proxy,
		                                                   "org.ofono.NetworkRegistration",
		                                                   dbus_g_proxy_get_path (modem->proxy));
		if (!modem->netreg_proxy) {
			g_warning ("failed to find the oFono NetworkRegistration '%s'",
			           dbus_g_proxy_get_path (modem->proxy));
		} else {
			org_ofono_NetworkRegistration_get_properties_async (modem->netreg_proxy,
																(org_ofono_NetworkRegistration_get_properties_reply)net_reg_get_properties_cb,
																modem);
			dbus_g_proxy_add_signal (modem->netreg_proxy,"PropertyChanged",
									 G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID);
			dbus_g_proxy_connect_signal (modem->netreg_proxy, "PropertyChanged",
										 G_CALLBACK (netreg_property_changed_cb),
										 modem, NULL);
		}
	}
}
Esempio n. 30
0
static void
service_dispose (GObject *object)
{
  CmService *service = CM_SERVICE (object);
  CmServicePrivate *priv = service->priv;

  if (priv->proxy)
  {
    dbus_g_proxy_disconnect_signal (
      priv->proxy, "PropertyChanged",
      G_CALLBACK (service_property_change_handler_proxy),
      service);

    g_object_unref (priv->proxy);
    priv->proxy = NULL;
  }

  priv->manager = NULL;

  G_OBJECT_CLASS (service_parent_class)->dispose (object);
}