From a72b53d583f8fd67d3c22cd74b4c15d1768970d8 Mon Sep 17 00:00:00 2001 From: moosd Date: Sun, 11 Sep 2016 04:56:41 +0100 Subject: [PATCH] Fixed typos (.idk -> .idx) and slightly simplified code --- src/org/kiwix/kiwixmobile/views/AutoCompleteAdapter.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/org/kiwix/kiwixmobile/views/AutoCompleteAdapter.java b/src/org/kiwix/kiwixmobile/views/AutoCompleteAdapter.java index a8e289fde..d5525f498 100644 --- a/src/org/kiwix/kiwixmobile/views/AutoCompleteAdapter.java +++ b/src/org/kiwix/kiwixmobile/views/AutoCompleteAdapter.java @@ -84,15 +84,13 @@ public class AutoCompleteAdapter extends ArrayAdapter implements Filtera if (!names[0].substring(names[0].length() - 3).equals("zim")){ names[0] = names[0].substring(0, names[0].length() - 2); } - names[0] += ".idk"; - names[1] += ".idx"; for(String name : names) { // try possible places for index directory - File f = new File(name); + File f = new File(name + ".idx"); if (f.exists() && f.isDirectory()) { - return name; // index in directory .zim.idk or .zimaa.idx + return name + ".idx"; // index in directory .zim.idx or .zimaa.idx } } - return file; // index is in zim file itself... (TODO :: test if actually the case, and which zim file if this is a multi-zim wiki?) + return file; // index is in zim file itself... } @Override