mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-15 10:26:53 -04:00
Fixed typos (.idk -> .idx) and slightly simplified code
This commit is contained in:
parent
39c22a806c
commit
a72b53d583
@ -84,15 +84,13 @@ public class AutoCompleteAdapter extends ArrayAdapter<String> implements Filtera
|
|||||||
if (!names[0].substring(names[0].length() - 3).equals("zim")){
|
if (!names[0].substring(names[0].length() - 3).equals("zim")){
|
||||||
names[0] = names[0].substring(0, names[0].length() - 2);
|
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
|
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()) {
|
if (f.exists() && f.isDirectory()) {
|
||||||
return name; // index in directory <zimfile>.zim.idk or <zimfile>.zimaa.idx
|
return name + ".idx"; // index in directory <zimfile>.zim.idx or <zimfile>.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
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user