From cf4322dc3fdc337307e83ae65ef36dd89f8ef7c1 Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Thu, 12 Sep 2013 08:10:49 +0200 Subject: refactoring: cleanup of gcvote code --- main/src/cgeo/geocaching/LogCacheActivity.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'main/src/cgeo/geocaching/LogCacheActivity.java') diff --git a/main/src/cgeo/geocaching/LogCacheActivity.java b/main/src/cgeo/geocaching/LogCacheActivity.java index 41d3854..0ff0c97 100644 --- a/main/src/cgeo/geocaching/LogCacheActivity.java +++ b/main/src/cgeo/geocaching/LogCacheActivity.java @@ -213,7 +213,7 @@ public class LogCacheActivity extends AbstractLoggingActivity implements DateDia if (!postButton.isEnabled()) { return res.getString(R.string.log_post_not_possible); } - if (!Settings.isGCvoteLogin() || !cache.supportsGCVote()) { + if (!GCVote.isVotingPossible(cache)) { return res.getString(R.string.log_post); } if (GCVote.isValidRating(rating)) { @@ -423,8 +423,7 @@ public class LogCacheActivity extends AbstractLoggingActivity implements DateDia public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); - final boolean voteAvailable = Settings.isGCvoteLogin() && StringUtils.isNotBlank(cache.getGuid()) && cache.supportsGCVote(); - menu.findItem(SUBMENU_VOTE).setVisible(voteAvailable); + menu.findItem(SUBMENU_VOTE).setVisible(GCVote.isVotingPossible(cache)); return true; } -- cgit v1.1