Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2018-04-03 10:07:00 +02:00
commit 05dc721fab
2 changed files with 10 additions and 1 deletions

View file

@ -65,7 +65,8 @@ public class WikivoyageDbHelper {
SEARCH_TABLE_NAME + "." + SEARCH_COL_CITY_ID + ", " + SEARCH_TABLE_NAME + "." + SEARCH_COL_CITY_ID + ", " +
SEARCH_COL_ARTICLE_TITLE + ", " + SEARCH_COL_ARTICLE_TITLE + ", " +
SEARCH_TABLE_NAME + "." + SEARCH_COL_LANG + ", " + SEARCH_TABLE_NAME + "." + SEARCH_COL_LANG + ", " +
ARTICLES_COL_IS_PART_OF + ARTICLES_COL_IS_PART_OF + ", " +
ARTICLES_COL_IMAGE_TITLE +
" FROM " + SEARCH_TABLE_NAME + " FROM " + SEARCH_TABLE_NAME +
" JOIN " + ARTICLES_TABLE_NAME + " JOIN " + ARTICLES_TABLE_NAME +
" ON " + SEARCH_TABLE_NAME + "." + SEARCH_COL_ARTICLE_TITLE + " = " + ARTICLES_TABLE_NAME + "." + ARTICLES_COL_TITLE + " ON " + SEARCH_TABLE_NAME + "." + SEARCH_COL_ARTICLE_TITLE + " = " + ARTICLES_TABLE_NAME + "." + ARTICLES_COL_TITLE +
@ -185,6 +186,7 @@ public class WikivoyageDbHelper {
res.articleTitles.add(cursor.getString(2)); res.articleTitles.add(cursor.getString(2));
res.langs.add(cursor.getString(3)); res.langs.add(cursor.getString(3));
res.isPartOf = cursor.getString(4); res.isPartOf = cursor.getString(4);
res.imageTitle = cursor.getString(5);
return res; return res;
} }

View file

@ -17,6 +17,7 @@ public class WikivoyageSearchResult implements Parcelable {
List<String> articleTitles = new ArrayList<>(); List<String> articleTitles = new ArrayList<>();
List<String> langs = new ArrayList<>(); List<String> langs = new ArrayList<>();
String isPartOf; String isPartOf;
String imageTitle;
WikivoyageSearchResult() { WikivoyageSearchResult() {
@ -28,6 +29,7 @@ public class WikivoyageSearchResult implements Parcelable {
articleTitles = in.createStringArrayList(); articleTitles = in.createStringArrayList();
langs = in.createStringArrayList(); langs = in.createStringArrayList();
isPartOf = in.readString(); isPartOf = in.readString();
imageTitle = in.readString();
} }
public List<String> getSearchTerms() { public List<String> getSearchTerms() {
@ -50,6 +52,10 @@ public class WikivoyageSearchResult implements Parcelable {
return isPartOf; return isPartOf;
} }
public String getImageTitle() {
return imageTitle;
}
public String getFirstLangsString() { public String getFirstLangsString() {
StringBuilder res = new StringBuilder(); StringBuilder res = new StringBuilder();
int limit = Math.min(SHOW_LANGS, langs.size()); int limit = Math.min(SHOW_LANGS, langs.size());
@ -74,6 +80,7 @@ public class WikivoyageSearchResult implements Parcelable {
dest.writeStringList(articleTitles); dest.writeStringList(articleTitles);
dest.writeStringList(langs); dest.writeStringList(langs);
dest.writeString(isPartOf); dest.writeString(isPartOf);
dest.writeString(imageTitle);
} }
public static final Creator<WikivoyageSearchResult> CREATOR = new Creator<WikivoyageSearchResult>() { public static final Creator<WikivoyageSearchResult> CREATOR = new Creator<WikivoyageSearchResult>() {