diff options
author | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | 2014-01-24 02:07:27 +0000 |
---|---|---|
committer | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | 2014-01-24 02:07:27 +0000 |
commit | 88d42b447a17732fdfddde1de307e43fd23244aa (patch) | |
tree | c88d80f5d90154c5e42f7d8946c1350ecbec9ec5 /src/gclue-location-source.c | |
parent | 4abe478a84d19b47de12e9fa3dab071d1b3b2c81 (diff) | |
download | geoclue-88d42b447a17732fdfddde1de307e43fd23244aa.tar.gz |
location-source: Make start/stop explicit
All location sources are now always active from creation to destruction.
Diffstat (limited to 'src/gclue-location-source.c')
-rw-r--r-- | src/gclue-location-source.c | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/src/gclue-location-source.c b/src/gclue-location-source.c index f88d823..8a7f1d7 100644 --- a/src/gclue-location-source.c +++ b/src/gclue-location-source.c @@ -35,29 +35,18 @@ G_DEFINE_ABSTRACT_TYPE (GClueLocationSource, gclue_location_source, G_TYPE_OBJEC struct _GClueLocationSourcePrivate { GeocodeLocation *location; - - gboolean active; }; enum { PROP_0, PROP_LOCATION, - PROP_ACTIVE, LAST_PROP }; static GParamSpec *gParamSpecs[LAST_PROP]; static void -gclue_location_source_finalize (GObject *object) -{ - gclue_location_source_stop (GCLUE_LOCATION_SOURCE (object)); - - G_OBJECT_CLASS (gclue_location_source_parent_class)->finalize (object); -} - -static void gclue_location_source_get_property (GObject *object, guint prop_id, GValue *value, @@ -70,10 +59,6 @@ gclue_location_source_get_property (GObject *object, g_value_set_object (value, source->priv->location); break; - case PROP_ACTIVE: - g_value_set_boolean (value, source->priv->active); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -107,7 +92,6 @@ gclue_location_source_class_init (GClueLocationSourceClass *klass) GObjectClass *object_class; object_class = G_OBJECT_CLASS (klass); - object_class->finalize = gclue_location_source_finalize; object_class->get_property = gclue_location_source_get_property; object_class->set_property = gclue_location_source_set_property; g_type_class_add_private (object_class, sizeof (GClueLocationSourcePrivate)); @@ -120,15 +104,6 @@ gclue_location_source_class_init (GClueLocationSourceClass *klass) g_object_class_install_property (object_class, PROP_LOCATION, gParamSpecs[PROP_LOCATION]); - - gParamSpecs[PROP_ACTIVE] = g_param_spec_boolean ("active", - "Active", - "Active", - FALSE, - G_PARAM_READABLE); - g_object_class_install_property (object_class, - PROP_ACTIVE, - gParamSpecs[PROP_ACTIVE]); } static void @@ -141,42 +116,6 @@ gclue_location_source_init (GClueLocationSource *source) } /** - * gclue_location_source_start: - * @source: a #GClueLocationSource - * - * Start searching for location and keep an eye on location changes. - **/ -void -gclue_location_source_start (GClueLocationSource *source) -{ - g_return_if_fail (GCLUE_IS_LOCATION_SOURCE (source)); - - if (source->priv->active) - return; /* Already started */ - - GCLUE_LOCATION_SOURCE_GET_CLASS (source)->start (source); - source->priv->active = TRUE; - g_object_notify (G_OBJECT (source), "active"); -} - -/** - * gclue_location_source_stop: - * @source: a #GClueLocationSource - * - * Stop searching for location and no need to keep an eye on location changes - * anymore. - **/ -void -gclue_location_source_stop (GClueLocationSource *source) -{ - g_return_if_fail (GCLUE_IS_LOCATION_SOURCE (source)); - - GCLUE_LOCATION_SOURCE_GET_CLASS (source)->stop (source); - source->priv->active = FALSE; - g_object_notify (G_OBJECT (source), "active"); -} - -/** * gclue_location_source_get_location: * @source: a #GClueLocationSource * @@ -215,17 +154,3 @@ gclue_location_source_set_location (GClueLocationSource *source, g_object_notify (G_OBJECT (source), "location"); } - -/** - * gclue_location_source_get_active: - * @source: a #GClueLocationSource - * - * Returns: TRUE if source is active, FALSE otherwise. - **/ -gboolean -gclue_location_source_get_active (GClueLocationSource *source) -{ - g_return_val_if_fail (GCLUE_IS_LOCATION_SOURCE (source), FALSE); - - return source->priv->active; -} |