Minor cleanup

This commit is contained in:
Peter Osterlund 2020-03-21 17:35:44 +01:00
parent 06bf2ab17f
commit 287f2dae4a

View File

@ -115,10 +115,9 @@ public class EditFilePreference extends EditTextPreference {
currentPath = newPath;
}
final String action = FileBrowseUtil.getPickAction(pickDirectory);
final String title = getContext().getString(pickDirectory ? R.string.select_directory
String title = getContext().getString(pickDirectory ? R.string.select_directory
: R.string.select_file);
Intent i = new Intent(action);
Intent i = new Intent(FileBrowseUtil.getPickAction(pickDirectory));
i.setData(Uri.fromFile(new File(currentPath)));
i.putExtra("org.openintents.extra.TITLE", title);
try {
@ -140,9 +139,8 @@ public class EditFilePreference extends EditTextPreference {
private boolean matchPattern(String s) {
if (ignorePattern.isEmpty())
return false;
Pattern p;
try {
p = Pattern.compile(ignorePattern);
Pattern p = Pattern.compile(ignorePattern);
return p.matcher(s).find();
} catch (PatternSyntaxException ex) {
return false;