OPML reader now uses 'title' attribute if available

This commit is contained in:
daniel oeh 2012-12-15 18:51:33 +01:00
parent 64348e4f18
commit d07afe16ae
1 changed files with 9 additions and 1 deletions

View File

@ -56,7 +56,15 @@ public class OpmlReader {
if (AppConfig.DEBUG) if (AppConfig.DEBUG)
Log.d(TAG, "Found new Opml element"); Log.d(TAG, "Found new Opml element");
OpmlElement element = new OpmlElement(); OpmlElement element = new OpmlElement();
element.setText(xpp.getAttributeValue(null, OpmlSymbols.TEXT));
final String title = xpp.getAttributeValue(null, OpmlSymbols.TITLE);
if (title != null) {
Log.i(TAG, "Using title: " + title);
element.setText(title);
} else {
Log.i(TAG, "Title not found, using text");
element.setText(xpp.getAttributeValue(null, OpmlSymbols.TEXT));
}
element.setXmlUrl(xpp.getAttributeValue(null, OpmlSymbols.XMLURL)); element.setXmlUrl(xpp.getAttributeValue(null, OpmlSymbols.XMLURL));
element.setHtmlUrl(xpp.getAttributeValue(null, OpmlSymbols.HTMLURL)); element.setHtmlUrl(xpp.getAttributeValue(null, OpmlSymbols.HTMLURL));
element.setType(xpp.getAttributeValue(null, OpmlSymbols.TYPE)); element.setType(xpp.getAttributeValue(null, OpmlSymbols.TYPE));