diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2011-10-03 13:47:07 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2011-10-03 13:47:07 +0200 |
| commit | f52b1f0c1a58978efd5e8478f29484cb1f3b421e (patch) | |
| tree | 39080018d83b12407a7df47153431464173e5e19 /main/src/cgeo/geocaching/activity/AbstractActivity.java | |
| parent | e99ed4d71470da9efe59f4b363762d105dbfdc6d (diff) | |
| download | cgeo-f52b1f0c1a58978efd5e8478f29484cb1f3b421e.zip cgeo-f52b1f0c1a58978efd5e8478f29484cb1f3b421e.tar.gz cgeo-f52b1f0c1a58978efd5e8478f29484cb1f3b421e.tar.bz2 | |
fix #120: make settings static (no singleton)
* Settings can no longer be instantiated, everything is static instead.
* Most option values are no longer cached in fields. This has been done
for clarity during the refactoring. I will add some performance tests
afterwards and may re-introduce those fields for caching the option
values.
Sorry, if anyone gets merge issues afterwards. There was no easier way
to implement this...
Diffstat (limited to 'main/src/cgeo/geocaching/activity/AbstractActivity.java')
| -rw-r--r-- | main/src/cgeo/geocaching/activity/AbstractActivity.java | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/main/src/cgeo/geocaching/activity/AbstractActivity.java b/main/src/cgeo/geocaching/activity/AbstractActivity.java index be3a8f9..5359b5e 100644 --- a/main/src/cgeo/geocaching/activity/AbstractActivity.java +++ b/main/src/cgeo/geocaching/activity/AbstractActivity.java @@ -2,7 +2,7 @@ package cgeo.geocaching.activity; import cgeo.geocaching.cgBase; import cgeo.geocaching.cgCache; -import cgeo.geocaching.cgSettings; +import cgeo.geocaching.Settings; import cgeo.geocaching.cgeoapplication; import android.app.Activity; @@ -19,7 +19,6 @@ public abstract class AbstractActivity extends Activity implements IAbstractActi protected cgeoapplication app = null; protected Resources res = null; - protected cgSettings settings = null; protected cgBase base = null; protected SharedPreferences prefs = null; @@ -70,13 +69,8 @@ public abstract class AbstractActivity extends Activity implements IAbstractActi // init res = this.getResources(); app = (cgeoapplication) this.getApplication(); - prefs = getSharedPreferences(cgSettings.preferences, Context.MODE_PRIVATE); - settings = new cgSettings(this, prefs); - base = new cgBase(app, settings); - } - - final public cgSettings getSettings() { - return settings; + prefs = getSharedPreferences(Settings.preferences, Context.MODE_PRIVATE); + base = new cgBase(app); } public void addVisitMenu(Menu menu, cgCache cache) { |
