aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/loaders/RemoveFromHistoryLoader.java
blob: 8ca0fa51b0bf2a7c63ff32e823d7992787bd4dc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package cgeo.geocaching.loaders;

import cgeo.geocaching.DataStore;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.settings.Settings;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.geopoint.Geopoint;

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;
        this.coords = coords;
    }

    @Override
    public SearchResult runSearch() {
        DataStore.clearVisitDate(selected);
        return DataStore.getHistoryOfCaches(true, coords != null ? Settings.getCacheType() : CacheType.ALL);
    }

}