Commit b21b6367 authored by Toni Beier's avatar Toni Beier

Refactoring: Rename onManagedError in CourseParseCallback class to onCoursesParsed

parent b97faefc
...@@ -12,5 +12,5 @@ public interface CourseParseCallback { ...@@ -12,5 +12,5 @@ public interface CourseParseCallback {
public void onSuccess(); public void onSuccess();
public void onManagedError(CourseList parsed); public void onCoursesParsed(CourseList parsedCourses);
} }
...@@ -42,9 +42,9 @@ class TimetableCallback implements ParserCallback<CourseList> { ...@@ -42,9 +42,9 @@ class TimetableCallback implements ParserCallback<CourseList> {
} }
@Override @Override
public void onManagedError(CourseList parsed) { public void onManagedError(CourseList parsedCourses) {
if (pc != null) { if (pc != null) {
pc.onManagedError(parsed); pc.onCoursesParsed(parsedCourses);
} else if (pg != null) { } else if (pg != null) {
pg.dismiss(); pg.dismiss();
} }
......
...@@ -118,7 +118,7 @@ public class TimetableFragment extends AbstractASiSTFragment { ...@@ -118,7 +118,7 @@ public class TimetableFragment extends AbstractASiSTFragment {
} }
@Override @Override
public void onManagedError(final CourseList parsedCourses) { public void onCoursesParsed(final CourseList parsedCourses) {
// Called also after parsing was successfully done, but in background thread. // Called also after parsing was successfully done, but in background thread.
// FIX: rename method and add documentation // FIX: rename method and add documentation
/* /*
......
...@@ -67,15 +67,15 @@ public class UICallback implements CourseParseCallback { ...@@ -67,15 +67,15 @@ public class UICallback implements CourseParseCallback {
} }
@Override @Override
public void onManagedError(CourseList result){ public void onCoursesParsed(CourseList parsedCourses){
if(result.getCode() == null){ if(parsedCourses.getCode() == null){
return; return;
} }
FragmentManager fm = context.getSupportFragmentManager(); FragmentManager fm = context.getSupportFragmentManager();
String errorReason = result.getMessage(); String errorReason = parsedCourses.getMessage();
String code = "Code:" + result.getCode(); String code = "Code:" + parsedCourses.getCode();
String uri = "Uri:" + result.getUri(); String uri = "Uri:" + parsedCourses.getUri();
String status = "Status:" + result.getStatus(); String status = "Status:" + parsedCourses.getStatus();
ASiSTDialog dialog; ASiSTDialog dialog;
if(BuildConfig.DEBUG) { if(BuildConfig.DEBUG) {
dialog = new ASiSTDialog(translate(R.string.timetable_import_error_message), errorReason + "\n\n" + code + "\n\n" + uri + "\n\n" + status, true, false); dialog = new ASiSTDialog(translate(R.string.timetable_import_error_message), errorReason + "\n\n" + code + "\n\n" + uri + "\n\n" + status, true, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment