From 4861e6d2c805b8ddef8b246acc524424899c73f1 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 28 Aug 2013 16:52:04 +0100 Subject: [PATCH 04/16] mcd_operation_take_mission, _remove_mission: do not be virtual Nothing overrides them, they're no longer API, and one day I'd like to get rid of McdOperation entirely. --- src/mcd-operation.c | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/src/mcd-operation.c b/src/mcd-operation.c index 7ddba66..7f01156 100644 --- a/src/mcd-operation.c +++ b/src/mcd-operation.c @@ -166,10 +166,14 @@ _mcd_operation_disconnect (McdMission * mission) MCD_MISSION_CLASS (mcd_operation_parent_class)->disconnect (mission); } -static void -_mcd_operation_take_mission (McdOperation * operation, McdMission * mission) +void +mcd_operation_take_mission (McdOperation * operation, McdMission * mission) { - McdOperationPrivate *priv = MCD_OPERATION_PRIV (operation); + McdOperationPrivate *priv; + + g_return_if_fail (MCD_IS_OPERATION (operation)); + g_return_if_fail (MCD_IS_MISSION (mission)); + priv = MCD_OPERATION_PRIV (operation); priv->missions = g_list_prepend (priv->missions, mission); _mcd_mission_set_parent (mission, MCD_MISSION (operation)); @@ -182,10 +186,14 @@ _mcd_operation_take_mission (McdOperation * operation, McdMission * mission) g_signal_emit_by_name (G_OBJECT (operation), "mission-taken", mission); } -static void -_mcd_operation_remove_mission (McdOperation * operation, McdMission * mission) +void +mcd_operation_remove_mission (McdOperation * operation, McdMission * mission) { - McdOperationPrivate *priv = MCD_OPERATION_PRIV (operation); + McdOperationPrivate *priv; + + g_return_if_fail (MCD_IS_OPERATION (operation)); + g_return_if_fail (MCD_IS_MISSION (mission)); + priv = MCD_OPERATION_PRIV (operation); g_return_if_fail (g_list_find (priv->missions, mission) != NULL); @@ -214,9 +222,6 @@ mcd_operation_class_init (McdOperationClass * klass) mission_class->connect = _mcd_operation_connect; mission_class->disconnect = _mcd_operation_disconnect; - klass->take_mission = _mcd_operation_take_mission; - klass->remove_mission = _mcd_operation_remove_mission; - mcd_operation_signals[MISSION_TAKEN] = g_signal_new ("mission-taken", G_OBJECT_CLASS_TYPE (klass), @@ -260,22 +265,6 @@ mcd_operation_new (void) return obj; } -void -mcd_operation_take_mission (McdOperation * operation, McdMission * mission) -{ - g_return_if_fail (MCD_IS_OPERATION (operation)); - g_return_if_fail (MCD_IS_MISSION (mission)); - MCD_OPERATION_GET_CLASS (operation)->take_mission (operation, mission); -} - -void -mcd_operation_remove_mission (McdOperation * operation, McdMission * mission) -{ - g_return_if_fail (MCD_IS_OPERATION (operation)); - g_return_if_fail (MCD_IS_MISSION (mission)); - MCD_OPERATION_GET_CLASS (operation)->remove_mission (operation, mission); -} - const GList * mcd_operation_get_missions (McdOperation * operation) { -- 1.8.4.rc3