Example #1
0
static void
gn_combo_history_set_property (GObject  *object, guint prop_id, const GValue *value,
			       GParamSpec *spec)
{
	GnComboHistory *history;

	g_return_if_fail (GN_IS_COMBO_HISTORY (object));

	history = GN_COMBO_HISTORY (object);

	switch (prop_id) {
	case PROP_COMBO:
		history->priv->combo = g_value_get_pointer (value);
		break;
	case PROP_ID:
		if (history->priv->id) g_free (history->priv->id);
		history->priv->id = g_value_dup_string (value);
		break;
	case PROP_MAX_HISTORY:
		history->priv->max_history = g_value_get_uint (value);
		break;
	default:
		break;
	}
}
Example #2
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);

		g_object_unref (G_OBJECT (history->priv->settings));
		history->priv->settings = NULL;
	}

	if (G_OBJECT_CLASS (parent_class)->finalize)
		(* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
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);
}
Example #4
0
void
netinfo_set_host (Netinfo * netinfo, const gchar *host)
{
	g_return_if_fail (netinfo != NULL);
	g_return_if_fail (GN_IS_COMBO_HISTORY (netinfo->history));

	gn_combo_history_add (GN_COMBO_HISTORY (netinfo->history), host);
}
Example #5
0
void
netinfo_set_user (Netinfo * netinfo, const gchar *user)
{
	g_return_if_fail (netinfo != NULL);
	g_return_if_fail (GN_IS_COMBO_HISTORY (netinfo->history_user));

	gn_combo_history_add (GN_COMBO_HISTORY (netinfo->history_user), user);
}
static void
gn_on_mateconf_history_changed (MateConfClient *client, guint cnxn_id,
			     MateConfEntry *entry, gpointer gdata)
{
	GnComboHistory *history;

	history = GN_COMBO_HISTORY (gdata);

	gn_combo_history_mateconf_load (history);
	gn_combo_history_set_popdown_strings (history);
}
Example #7
0
static void
gn_on_settings_history_changed (GSettings *settings, gchar *key, gpointer gdata)
{
	GnComboHistory *history;

	history = GN_COMBO_HISTORY (gdata);

	if (!g_str_equal (key, history->priv->id))
		return;

	gn_combo_history_settings_load (history);
	gn_combo_history_set_popdown_strings (history);
}
Example #8
0
static void
gn_combo_history_get_property (GObject  *object, guint prop_id, GValue *value,
			       GParamSpec *spec)
{
	GnComboHistory *history;

	g_return_if_fail (GN_IS_COMBO_HISTORY (object));

	history = GN_COMBO_HISTORY (object);

	switch (prop_id) {
	case PROP_COMBO:
		g_value_set_pointer (value, history->priv->combo);
		break;
	case PROP_ID:
		g_value_set_string (value, history->priv->id);
		break;
	case PROP_MAX_HISTORY:
		g_value_set_uint (value, history->priv->max_history);
		break;
	default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, spec);
	}
}