diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2012-12-30 14:14:55 +0100 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2012-12-30 14:14:55 +0100 |
| commit | 6dad55f6843fee707c0d06df4b268563a7eb7374 (patch) | |
| tree | 7a0d1989be41571312ac66698d28a23e21c80bac /main/src/cgeo/geocaching | |
| parent | aba2786ec38c1653b92c3affd88d2060c1d6b8df (diff) | |
| download | cgeo-6dad55f6843fee707c0d06df4b268563a7eb7374.zip cgeo-6dad55f6843fee707c0d06df4b268563a7eb7374.tar.gz cgeo-6dad55f6843fee707c0d06df4b268563a7eb7374.tar.bz2 | |
Add restrictions documentation on favorite handling
Diffstat (limited to 'main/src/cgeo/geocaching')
| -rw-r--r-- | main/src/cgeo/geocaching/connector/gc/GCConnector.java | 18 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/connector/gc/GCParser.java | 6 |
2 files changed, 23 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/connector/gc/GCConnector.java b/main/src/cgeo/geocaching/connector/gc/GCConnector.java index 5de170b..b196504 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCConnector.java +++ b/main/src/cgeo/geocaching/connector/gc/GCConnector.java @@ -149,6 +149,15 @@ public class GCConnector extends AbstractConnector implements ISearchByGeocode, return removed; } + /** + * Add a cache to the favorites list. + * + * This must not be called from the UI thread. + * + * @param cache the cache to add + * @return <code>true</code> if the cache was sucessfully added, <code>false</code> otherwise + */ + public static boolean addToFavorites(cgCache cache) { final boolean added = GCParser.addToFavorites(cache); if (added) { @@ -157,6 +166,15 @@ public class GCConnector extends AbstractConnector implements ISearchByGeocode, return added; } + /** + * Remove a cache from the favorites list. + * + * This must not be called from the UI thread. + * + * @param cache the cache to add + * @return <code>true</code> if the cache was sucessfully added, <code>false</code> otherwise + */ + public static boolean removeFromFavorites(cgCache cache) { final boolean removed = GCParser.removeFromFavorites(cache); if (removed) { diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java index c40d470..fd4e3fa 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCParser.java +++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java @@ -1204,6 +1204,8 @@ public abstract class GCParser { /** * Adds the cache to the favorites of the user. * + * This must not be called from the UI thread. + * * @param cache * the cache to add * @return <code>false</code> if an error occurred, <code>true</code> otherwise @@ -1234,7 +1236,9 @@ public abstract class GCParser { } /** - * Removes the cache from the Favorites + * Removes the cache from the favorites. + * + * This must not be called from the UI thread. * * @param cache * the cache to remove |
