aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-04-27 12:10:35 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-04-27 12:10:35 +0200
commita34f53aa9c4ccff774d41278bbc301e2cdda7033 (patch)
treefb94e5f6db50426a55822087f6e7a10c00315fa2 /main
parenta5780d1ac9c147a2f9aeb862bddc93fe1394d387 (diff)
downloadcgeo-a34f53aa9c4ccff774d41278bbc301e2cdda7033.zip
cgeo-a34f53aa9c4ccff774d41278bbc301e2cdda7033.tar.gz
cgeo-a34f53aa9c4ccff774d41278bbc301e2cdda7033.tar.bz2
Reflect the fact that GeoDataProvider does not depend on cgeoapplication
The dependency was useless and confusing, considering that cgeoapplication is a singleton while GeoDataProvider is not.
Diffstat (limited to 'main')
-rw-r--r--main/src/cgeo/geocaching/GeoDataProvider.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/GeoDataProvider.java b/main/src/cgeo/geocaching/GeoDataProvider.java
index 500843c..2281d59 100644
--- a/main/src/cgeo/geocaching/GeoDataProvider.java
+++ b/main/src/cgeo/geocaching/GeoDataProvider.java
@@ -34,8 +34,6 @@ class GeoDataProvider extends MemorySubject<IGeoData> {
private GeoData current = new GeoData();
private final Unregisterer unregisterer = new Unregisterer();
- final private cgeoapplication app;
-
private static class GeoData implements Cloneable, IGeoData {
public Location location = null;
public LocationProviderType locationProvider = LocationProviderType.LAST;
@@ -159,11 +157,10 @@ class GeoDataProvider extends MemorySubject<IGeoData> {
* There is no need to instantiate more than one such object in an application, as observers can be added
* at will.
*
- * @param app the application
+ * @param context the context used to retrieve the system services
*/
- public GeoDataProvider(final cgeoapplication app) {
- geoManager = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE);
- this.app = app;
+ public GeoDataProvider(final Context context) {
+ geoManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
unregisterer.start();
// Start with an empty GeoData just in case someone queries it before we get
// a chance to get any information.