Fix last commit

This commit is contained in:
len 2016-03-19 00:22:13 +01:00
parent 6b326cfb79
commit b8bc3476f4
4 changed files with 5 additions and 9 deletions

View File

@ -2,6 +2,5 @@ package eu.kanade.tachiyomi.event
import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.source.base.Source
class ReaderEvent(val source: Source, val manga: Manga, val chapter: Chapter)
class ReaderEvent(val manga: Manga, val chapter: Chapter)

View File

@ -179,7 +179,7 @@ class ChaptersPresenter : BasePresenter<ChaptersFragment>() {
}
fun onOpenChapter(chapter: Chapter) {
EventBus.getDefault().postSticky(ReaderEvent(source, manga, chapter))
EventBus.getDefault().postSticky(ReaderEvent(manga, chapter))
}
fun getNextUnreadChapter(): Chapter? {

View File

@ -48,7 +48,6 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
@State Manga manga;
@State Chapter activeChapter;
@State int sourceId;
@State int requestedPage;
private Page currentPage;
private Source source;
@ -72,7 +71,7 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
super.onCreate(savedState);
if (savedState != null) {
source = sourceManager.get(sourceId);
source = sourceManager.get(manga.source);
initializeSubjects();
}
@ -114,8 +113,7 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
public void onEvent(ReaderEvent event) {
EventBus.getDefault().removeStickyEvent(event);
manga = event.getManga();
source = event.getSource();
sourceId = source.getId();
source = sourceManager.get(manga.source);
initializeSubjects();
loadChapter(event.getChapter());
if (prefs.autoUpdateMangaSync()) {

View File

@ -250,8 +250,7 @@ class RecentChaptersPresenter : BasePresenter<RecentChaptersFragment>() {
* @param item chapter that is opened
*/
fun onOpenChapter(item: MangaChapter) {
val source = sourceManager.get(item.manga.source)
EventBus.getDefault().postSticky(ReaderEvent(source, item.manga, item.chapter))
EventBus.getDefault().postSticky(ReaderEvent(item.manga, item.chapter))
}
/**