aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/loaders
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/loaders')
-rw-r--r--main/src/cgeo/geocaching/loaders/AbstractSearchLoader.java13
-rw-r--r--main/src/cgeo/geocaching/loaders/AddressGeocacheListLoader.java23
-rw-r--r--main/src/cgeo/geocaching/loaders/CoordsGeocacheListLoader.java3
-rw-r--r--main/src/cgeo/geocaching/loaders/HistoryGeocacheListLoader.java4
-rw-r--r--main/src/cgeo/geocaching/loaders/KeywordGeocacheListLoader.java2
-rw-r--r--main/src/cgeo/geocaching/loaders/NextPageGeocacheListLoader.java2
-rw-r--r--main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java3
-rw-r--r--main/src/cgeo/geocaching/loaders/PocketGeocacheListLoader.java2
-rw-r--r--main/src/cgeo/geocaching/loaders/RemoveFromHistoryLoader.java28
9 files changed, 14 insertions, 66 deletions
diff --git a/main/src/cgeo/geocaching/loaders/AbstractSearchLoader.java b/main/src/cgeo/geocaching/loaders/AbstractSearchLoader.java
index b2cb0b2..8e4b114 100644
--- a/main/src/cgeo/geocaching/loaders/AbstractSearchLoader.java
+++ b/main/src/cgeo/geocaching/loaders/AbstractSearchLoader.java
@@ -29,7 +29,6 @@ public abstract class AbstractSearchLoader extends AsyncTaskLoader<SearchResult>
FINDER,
OWNER,
MAP,
- REMOVE_FROM_HISTORY,
NEXT_PAGE;
public int getLoaderId() {
@@ -43,9 +42,9 @@ public abstract class AbstractSearchLoader extends AsyncTaskLoader<SearchResult>
private String recaptchaText = null;
private SearchResult search;
private boolean loading;
- private CountDownLatch latch = new CountDownLatch(1);
+ private final CountDownLatch latch = new CountDownLatch(1);
- public AbstractSearchLoader(Context context) {
+ public AbstractSearchLoader(final Context context) {
super(context);
}
@@ -65,7 +64,7 @@ public abstract class AbstractSearchLoader extends AsyncTaskLoader<SearchResult>
// Unless we make a new Search the Loader framework won't deliver results. It does't do equals only identity
search = new SearchResult(search);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
Log.e("Error in Loader ", e);
}
loading = false;
@@ -95,13 +94,13 @@ public abstract class AbstractSearchLoader extends AsyncTaskLoader<SearchResult>
public void waitForUser() {
try {
latch.await();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException ignored) {
Log.w("searchThread is not waiting for user…");
}
}
@Override
- public void setKey(String key) {
+ public void setKey(final String key) {
recaptchaKey = key;
}
@@ -125,7 +124,7 @@ public abstract class AbstractSearchLoader extends AsyncTaskLoader<SearchResult>
}
@Override
- public void setText(String text) {
+ public void setText(final String text) {
recaptchaText = text;
latch.countDown();
}
diff --git a/main/src/cgeo/geocaching/loaders/AddressGeocacheListLoader.java b/main/src/cgeo/geocaching/loaders/AddressGeocacheListLoader.java
deleted file mode 100644
index e1573c9..0000000
--- a/main/src/cgeo/geocaching/loaders/AddressGeocacheListLoader.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package cgeo.geocaching.loaders;
-
-import cgeo.geocaching.SearchResult;
-import cgeo.geocaching.connector.gc.GCParser;
-import cgeo.geocaching.settings.Settings;
-
-import android.content.Context;
-
-public class AddressGeocacheListLoader extends AbstractSearchLoader {
-
- private final String address;
-
- public AddressGeocacheListLoader(Context context, String address) {
- super(context);
- this.address = address;
- }
-
- @Override
- public SearchResult runSearch() {
- return GCParser.searchByAddress(address, Settings.getCacheType(), Settings.isShowCaptcha(), this);
- }
-
-}
diff --git a/main/src/cgeo/geocaching/loaders/CoordsGeocacheListLoader.java b/main/src/cgeo/geocaching/loaders/CoordsGeocacheListLoader.java
index c2d92bf..2549b7b 100644
--- a/main/src/cgeo/geocaching/loaders/CoordsGeocacheListLoader.java
+++ b/main/src/cgeo/geocaching/loaders/CoordsGeocacheListLoader.java
@@ -3,9 +3,10 @@ package cgeo.geocaching.loaders;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.connector.ConnectorFactory;
import cgeo.geocaching.connector.capability.ISearchByCenter;
-import cgeo.geocaching.geopoint.Geopoint;
+import cgeo.geocaching.location.Geopoint;
import org.eclipse.jdt.annotation.NonNull;
+
import rx.functions.Func1;
import android.content.Context;
diff --git a/main/src/cgeo/geocaching/loaders/HistoryGeocacheListLoader.java b/main/src/cgeo/geocaching/loaders/HistoryGeocacheListLoader.java
index fdb35f2..53e5de1 100644
--- a/main/src/cgeo/geocaching/loaders/HistoryGeocacheListLoader.java
+++ b/main/src/cgeo/geocaching/loaders/HistoryGeocacheListLoader.java
@@ -3,7 +3,7 @@ package cgeo.geocaching.loaders;
import cgeo.geocaching.DataStore;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.enumerations.CacheType;
-import cgeo.geocaching.geopoint.Geopoint;
+import cgeo.geocaching.location.Geopoint;
import cgeo.geocaching.settings.Settings;
import android.content.Context;
@@ -11,7 +11,7 @@ import android.content.Context;
public class HistoryGeocacheListLoader extends AbstractSearchLoader {
private final Geopoint coords;
- public HistoryGeocacheListLoader(Context context, Geopoint coords) {
+ public HistoryGeocacheListLoader(final Context context, final Geopoint coords) {
super(context);
this.coords = coords;
}
diff --git a/main/src/cgeo/geocaching/loaders/KeywordGeocacheListLoader.java b/main/src/cgeo/geocaching/loaders/KeywordGeocacheListLoader.java
index 45b264f..4c3baf5 100644
--- a/main/src/cgeo/geocaching/loaders/KeywordGeocacheListLoader.java
+++ b/main/src/cgeo/geocaching/loaders/KeywordGeocacheListLoader.java
@@ -13,7 +13,7 @@ public class KeywordGeocacheListLoader extends AbstractSearchLoader {
private final @NonNull String keyword;
- public KeywordGeocacheListLoader(Context context, final @NonNull String keyword) {
+ public KeywordGeocacheListLoader(final Context context, final @NonNull String keyword) {
super(context);
this.keyword = keyword;
}
diff --git a/main/src/cgeo/geocaching/loaders/NextPageGeocacheListLoader.java b/main/src/cgeo/geocaching/loaders/NextPageGeocacheListLoader.java
index 05eac18..cd81619 100644
--- a/main/src/cgeo/geocaching/loaders/NextPageGeocacheListLoader.java
+++ b/main/src/cgeo/geocaching/loaders/NextPageGeocacheListLoader.java
@@ -9,7 +9,7 @@ import android.content.Context;
public class NextPageGeocacheListLoader extends AbstractSearchLoader {
private final SearchResult search;
- public NextPageGeocacheListLoader(Context context, SearchResult search) {
+ public NextPageGeocacheListLoader(final Context context, final SearchResult search) {
super(context);
this.search = search;
}
diff --git a/main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java b/main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java
index 0d5af6a..b9fbc76 100644
--- a/main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java
+++ b/main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java
@@ -3,7 +3,7 @@ package cgeo.geocaching.loaders;
import cgeo.geocaching.DataStore;
import cgeo.geocaching.Intents;
import cgeo.geocaching.SearchResult;
-import cgeo.geocaching.geopoint.Geopoint;
+import cgeo.geocaching.location.Geopoint;
import cgeo.geocaching.settings.Settings;
import android.content.Context;
@@ -26,7 +26,6 @@ public class OfflineGeocacheListLoader extends AbstractSearchLoader {
}
/**
- * @param listId
* @return the bundle needed for querying the LoaderManager for the offline list with the given id
*/
public static Bundle getBundleForList(final int listId) {
diff --git a/main/src/cgeo/geocaching/loaders/PocketGeocacheListLoader.java b/main/src/cgeo/geocaching/loaders/PocketGeocacheListLoader.java
index 32fb020..47472be 100644
--- a/main/src/cgeo/geocaching/loaders/PocketGeocacheListLoader.java
+++ b/main/src/cgeo/geocaching/loaders/PocketGeocacheListLoader.java
@@ -9,7 +9,7 @@ import android.content.Context;
public class PocketGeocacheListLoader extends AbstractSearchLoader {
private final String guid;
- public PocketGeocacheListLoader(Context context, String guid) {
+ public PocketGeocacheListLoader(final Context context, final String guid) {
super(context);
this.guid = guid;
}
diff --git a/main/src/cgeo/geocaching/loaders/RemoveFromHistoryLoader.java b/main/src/cgeo/geocaching/loaders/RemoveFromHistoryLoader.java
deleted file mode 100644
index dc1a5df..0000000
--- a/main/src/cgeo/geocaching/loaders/RemoveFromHistoryLoader.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cgeo.geocaching.loaders;
-
-import cgeo.geocaching.DataStore;
-import cgeo.geocaching.SearchResult;
-import cgeo.geocaching.enumerations.CacheType;
-import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.settings.Settings;
-
-import android.content.Context;
-
-public class RemoveFromHistoryLoader extends AbstractSearchLoader {
-
- private final String[] selected;
- private final Geopoint coords;
-
- public RemoveFromHistoryLoader(Context context, String[] selected, Geopoint coords) {
- super(context);
- this.selected = selected.clone();
- this.coords = coords;
- }
-
- @Override
- public SearchResult runSearch() {
- DataStore.clearVisitDate(selected);
- return DataStore.getHistoryOfCaches(true, coords != null ? Settings.getCacheType() : CacheType.ALL);
- }
-
-}