From c645ee39ed4bb7fb7b3af9cf87ee5a2ff910c845 Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Tue, 7 May 2013 07:11:38 +0200 Subject: fix #2702: Don't allow to check ".." in path selection --- main/src/cgeo/geocaching/files/SimpleDirChooser.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'main/src') diff --git a/main/src/cgeo/geocaching/files/SimpleDirChooser.java b/main/src/cgeo/geocaching/files/SimpleDirChooser.java index 824173c..6b2366c 100644 --- a/main/src/cgeo/geocaching/files/SimpleDirChooser.java +++ b/main/src/cgeo/geocaching/files/SimpleDirChooser.java @@ -186,13 +186,12 @@ public class SimpleDirChooser extends AbstractListActivity { if (currentOption != lastOption) { currentOption.setChecked(true); lastPosition = position; - okButton.setEnabled(true); - okButton.setVisibility(View.VISIBLE); } else { lastPosition = -1; - okButton.setEnabled(false); - okButton.setVisibility(View.INVISIBLE); } + final boolean enabled = currentOption.isChecked() && !currentOption.getName().equals(PARENT_DIR); + okButton.setEnabled(enabled); + okButton.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE); adapter.notifyDataSetChanged(); } } -- cgit v1.1