diff --git a/extras/pandroid_event_viewer/ChangeLog b/extras/pandroid_event_viewer/ChangeLog index 7b37247ac4..de0f1af7a2 100644 --- a/extras/pandroid_event_viewer/ChangeLog +++ b/extras/pandroid_event_viewer/ChangeLog @@ -1,3 +1,10 @@ +2011-10-04 Miguel de Dios + + * src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java: + fixed the events about BadXML with returns. + + * res/values-es/strings.xml: fixed typo in the value "develop...". + 2011-10-04 Miguel de Dios * src/pandroid_event_viewer/pandorafms/Main.java: fixed the status value diff --git a/extras/pandroid_event_viewer/res/values-es/strings.xml b/extras/pandroid_event_viewer/res/values-es/strings.xml index c0fa606bd1..feceaa4164 100644 --- a/extras/pandroid_event_viewer/res/values-es/strings.xml +++ b/extras/pandroid_event_viewer/res/values-es/strings.xml @@ -77,7 +77,7 @@ Máx tiempo de antiguedad Licenciado bajo GPL v2 - Desarrado por: Miguel de Dios + Desarrollado por: Miguel de Dios Alerta recuperada Alerta validada manualmente diff --git a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java index 2c44438d9d..95733d3506 100644 --- a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java +++ b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java @@ -18,6 +18,8 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; @@ -339,7 +341,26 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ return_api = return_api.replaceAll("\\<.*?\\>", ""); //Clean html tags. //Work around for the crap of \n in this event bad xml - return_api = return_api.replaceAll("Unable to process XML data file.*?line 187 thread 5", "Bad XML"); + //return_api = return_api.replaceAll("Unable to process XML data file [^\n]*\n[^\n]*line 187 thread .\n", "Bad XML"); + + + + Pattern pattern = Pattern.compile("Unable to process XML data file '(.*)'"); + Matcher matcher; + String filename; + + boolean endReplace = false; int i22 = 0; + while (!endReplace) { Log.e("loop", i22 + ""); i22++; + matcher = pattern.matcher(return_api); + + if (matcher.find()) { + filename = matcher.group(1); + return_api = return_api.replaceFirst("Unable to process XML data file[^\n]*\n[^\n]*line 187 thread .*\n", "Bad XML: " + filename); + } + else { + endReplace = true; + } + } Log.e("return_api", return_api);