Esempio n. 1
0
static void
panel_addto_dialog_free (PanelAddtoDialog *dialog)
{
	MateConfClient *client;
	GSList      *item;

	client = panel_mateconf_get_client ();

	if (dialog->name_notify)
		mateconf_client_notify_remove (client, dialog->name_notify);
	dialog->name_notify = 0;

	if (dialog->search_text)
		g_free (dialog->search_text);
	dialog->search_text = NULL;

	if (dialog->applet_search_text)
		g_free (dialog->applet_search_text);
	dialog->applet_search_text = NULL;

	if (dialog->addto_dialog)
		gtk_widget_destroy (dialog->addto_dialog);
	dialog->addto_dialog = NULL;

	for (item = dialog->applet_list; item != NULL; item = item->next) {
		PanelAddtoItemInfo *applet;

		applet = (PanelAddtoItemInfo *) item->data;
		if (!applet->static_data) {
			panel_addto_dialog_free_item_info (applet);
			g_free (applet);
		}
	}
	g_slist_free (dialog->applet_list);

	panel_addto_dialog_free_application_list (dialog->application_list);
	panel_addto_dialog_free_application_list (dialog->settings_list);

	if (dialog->filter_applet_model)
		g_object_unref (dialog->filter_applet_model);
	dialog->filter_applet_model = NULL;

	if (dialog->applet_model)
		g_object_unref (dialog->applet_model);
	dialog->applet_model = NULL;

	if (dialog->filter_application_model)
		g_object_unref (dialog->filter_application_model);
	dialog->filter_application_model = NULL;

	if (dialog->application_model)
		g_object_unref (dialog->application_model);
	dialog->application_model = NULL;

	if (dialog->menu_tree)
		matemenu_tree_unref (dialog->menu_tree);
	dialog->menu_tree = NULL;

	g_free (dialog);
}
static void
impl_deactivate	(IdolPlugin *plugin,
		 IdolObject *idol)
{
	IdolScreensaverPlugin *pi = IDOL_SCREENSAVER_PLUGIN (plugin);
	MateConfClient *gc;

	gc = mateconf_client_get_default ();
	mateconf_client_notify_remove (gc, pi->handler_id_mateconf);
	g_object_unref (gc);

	if (pi->handler_id_playing != 0) {
		g_signal_handler_disconnect (G_OBJECT (idol), pi->handler_id_playing);
		pi->handler_id_playing = 0;
	}
	if (pi->handler_id_metadata != 0) {
		g_signal_handler_disconnect (G_OBJECT (pi->bvw), pi->handler_id_metadata);
		pi->handler_id_metadata = 0;
	}

	g_object_unref (pi->idol);
	g_object_unref (pi->bvw);

	idol_scrsaver_enable (pi->scr);
}
static void
pluma_drawspaces_plugin_dispose (GObject *object)
{
	PlumaDrawspacesPlugin *plugin = PLUMA_DRAWSPACES_PLUGIN (object);

	pluma_debug_message (DEBUG_PLUGINS, "PlumaDrawspacesPlugin disposing");

	if (plugin->priv->connection_id != 0)
	{
		mateconf_client_notify_remove (plugin->priv->mateconf_client,
					    plugin->priv->connection_id);

		plugin->priv->connection_id = 0;
	}

	if (plugin->priv->mateconf_client != NULL)
	{
		mateconf_client_suggest_sync (plugin->priv->mateconf_client, NULL);

		g_object_unref (G_OBJECT (plugin->priv->mateconf_client));

		plugin->priv->mateconf_client = NULL;
	}

	G_OBJECT_CLASS (pluma_drawspaces_plugin_parent_class)->dispose (object);
}
Esempio n. 4
0
static void
gn_combo_history_finalize (GObject *object)
{
	GnComboHistory *history = GN_COMBO_HISTORY (object);

	if (history->priv) {
		if (history->priv->combo) {
			g_object_unref (G_OBJECT (history->priv->combo));
			history->priv->combo = NULL;
		}

		if (history->priv->id) {
			g_free (history->priv->id);
			history->priv->id = NULL;
		}

		gn_combo_free_items (history);

		if (history->priv->mateconf_notify != 0) {
			mateconf_client_notify_remove (history->priv->mateconf_client,
						    history->priv->mateconf_notify);
			history->priv->mateconf_notify = 0;
		}

		if (history->priv->mateconf_client) {
			g_object_unref (G_OBJECT (history->priv->mateconf_client));
			history->priv->mateconf_client = NULL;
		}
	}

	if (G_OBJECT_CLASS (parent_class)->finalize)
		(* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
calendar_sources_finalize_source_data (CalendarSources    *sources,
				       CalendarSourceData *source_data)
{
  if (source_data->loaded)
    {
      GSList *l;

      if (source_data->selected_sources_dir)
	{
	  mateconf_client_remove_dir (sources->priv->mateconf_client,
				   source_data->selected_sources_dir,
				   NULL);

	  g_free (source_data->selected_sources_dir);
	  source_data->selected_sources_dir = NULL;
	}

      if (source_data->selected_sources_listener)
	{
	  mateconf_client_notify_remove (sources->priv->mateconf_client,
				      source_data->selected_sources_listener);
	  source_data->selected_sources_listener = 0;
	}

      for (l = source_data->clients; l; l = l->next)
        {
          g_signal_handlers_disconnect_by_func (G_OBJECT (l->data),
                                                G_CALLBACK (backend_died_cb),
                                                source_data);
          g_object_unref (l->data);
        }
      g_slist_free (source_data->clients);
      source_data->clients = NULL;

      if (source_data->esource_list)
        {
          g_signal_handlers_disconnect_by_func (source_data->esource_list,
                                                G_CALLBACK (calendar_sources_esource_list_changed),
                                                source_data);
          g_object_unref (source_data->esource_list);
	}
      source_data->esource_list = NULL;

      for (l = source_data->selected_sources; l; l = l->next)
	g_free (l->data);
      g_slist_free (source_data->selected_sources);
      source_data->selected_sources = NULL;

      if (source_data->timeout_id != 0)
        {
          g_source_remove (source_data->timeout_id);
          source_data->timeout_id = 0;
        }

      source_data->loaded = FALSE;
    }
}
Esempio n. 6
0
static void destroy_pager(GtkWidget* widget, PagerData* pager)
{
	MateConfClient* client = mateconf_client_get_default();

	mateconf_client_notify_remove(client, pager->listeners[0]);
	mateconf_client_notify_remove(client, pager->listeners[1]);
	mateconf_client_notify_remove(client, pager->listeners[2]);

	g_object_unref(G_OBJECT(client));

	pager->listeners[0] = 0;
	pager->listeners[1] = 0;
	pager->listeners[2] = 0;

	if (pager->properties_dialog)
		gtk_widget_destroy(pager->properties_dialog);

	g_free(pager);
}
static void
remove_notify_id (gpointer data)
{
	MateConfClient *client;

	client = mateconf_client_get_default ();
	mateconf_client_notify_remove (client, GPOINTER_TO_INT (data));

	g_object_unref (client);
}
/* Remove the notification callback when the widget monitoring
 * notifications is destroyed
 */
static void
configurable_widget_destroy_callback (GtkWidget *widget,
                                      gpointer   data)
{
  guint notify_id;
  MateConfClient *client;

  client = g_object_get_data (G_OBJECT (widget), "client");
  notify_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget), "notify_id"));

  if (notify_id != 0)
    mateconf_client_notify_remove (client, notify_id);
}
void
matecomponent_ui_preferences_remove_engine (MateComponentUIEngine *engine)
{
	if (!g_slist_find (engine_list, engine))
		return;

	engine_list = g_slist_remove (engine_list, engine);

	if (engine_list == NULL) {
		/* Remove notification */
		mateconf_client_remove_dir (client, GLOBAL_INTERFACE_KEY, NULL);
		mateconf_client_notify_remove (client, desktop_notify_id);
		desktop_notify_id = 0;
	}
}
static void
panel_action_button_finalize (GObject *object)
{
	PanelActionButton *button = PANEL_ACTION_BUTTON (object);

	button->priv->info = NULL;
	button->priv->type = PANEL_ACTION_NONE;

	panel_lockdown_notify_remove (G_CALLBACK (panel_action_button_update_sensitivity),
				      button);

	mateconf_client_notify_remove (panel_mateconf_get_client (),
				    button->priv->mateconf_notify);
	button->priv->mateconf_notify = 0;

	G_OBJECT_CLASS (panel_action_button_parent_class)->finalize (object);
}
static void
panel_menu_button_disconnect_from_mateconf (PanelMenuButton *button)
{
	MateConfClient *client;
	const char  *key;

	if (!button->priv->mateconf_notify)
		return;

	client  = panel_mateconf_get_client ();

	key = panel_mateconf_sprintf (PANEL_CONFIG_DIR "/objects/%s",
				   button->priv->applet_id);

	mateconf_client_notify_remove (client, button->priv->mateconf_notify);
	button->priv->mateconf_notify = 0;

	mateconf_client_remove_dir (client, key, NULL);
}
static void
tile_hide_event_cb (GtkWidget * widget, gpointer user_data)
{
    HardDriveStatusTile *tile = HARD_DRIVE_STATUS_TILE (widget);
    HardDriveStatusTilePrivate *priv = HARD_DRIVE_STATUS_TILE_GET_PRIVATE (tile);

    if (priv->timeout_notify)
    {
        mateconf_client_notify_remove (priv->mateconf, priv->timeout_notify);
        priv->timeout_notify = 0;
    }

    if (priv->update_timeout)
    {
        g_source_remove (priv->update_timeout);
        priv->update_timeout = 0;
    }

    update_tile (tile);
}
static void
hard_drive_status_tile_destroy (GtkObject * gtk_object)
{
    HardDriveStatusTile *tile = HARD_DRIVE_STATUS_TILE (gtk_object);
    HardDriveStatusTilePrivate *priv = HARD_DRIVE_STATUS_TILE_GET_PRIVATE (tile);

    if (!priv)
        return;

    if (priv->timeout_notify)
    {
        mateconf_client_notify_remove (priv->mateconf, priv->timeout_notify);
        priv->timeout_notify = 0;
    }

    if (priv->update_timeout)
    {
        g_source_remove (priv->update_timeout);
        priv->update_timeout = 0;
    }
}
static void
mateconf_bookmarks_dialog_destroy (GtkObject *object)
{
	MateConfClient *client;
	MateConfBookmarksDialog *dialog;
	
	client = mateconf_client_get_default ();
	dialog = MATECONF_BOOKMARKS_DIALOG (object);
	
	if (dialog->notify_id != 0) {
		mateconf_client_notify_remove (client, dialog->notify_id);
		mateconf_client_remove_dir (client, BOOKMARKS_KEY, NULL);
		dialog->notify_id = 0;
	}

	g_object_unref (client);
	
	if (GTK_OBJECT_CLASS (mateconf_bookmarks_dialog_parent_class)->destroy) {
		(* GTK_OBJECT_CLASS (mateconf_bookmarks_dialog_parent_class)->destroy) (object);
	}
}