From b8bc3476f4157e06f5cb3601b408e59bd47ba08d Mon Sep 17 00:00:00 2001 From: len Date: Sat, 19 Mar 2016 00:22:13 +0100 Subject: [PATCH] Fix last commit --- app/src/main/java/eu/kanade/tachiyomi/event/ReaderEvent.kt | 3 +-- .../kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt | 2 +- .../java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.java | 6 ++---- .../kanade/tachiyomi/ui/recent/RecentChaptersPresenter.kt | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/event/ReaderEvent.kt b/app/src/main/java/eu/kanade/tachiyomi/event/ReaderEvent.kt index b61f4c94d..e70e1c77b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/event/ReaderEvent.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/event/ReaderEvent.kt @@ -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) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt index d287def26..98149151f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt @@ -179,7 +179,7 @@ class ChaptersPresenter : BasePresenter() { } fun onOpenChapter(chapter: Chapter) { - EventBus.getDefault().postSticky(ReaderEvent(source, manga, chapter)) + EventBus.getDefault().postSticky(ReaderEvent(manga, chapter)) } fun getNextUnreadChapter(): Chapter? { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.java b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.java index e6daa24e6..896f87da1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.java @@ -48,7 +48,6 @@ public class ReaderPresenter extends BasePresenter { @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 { 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 { 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()) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/RecentChaptersPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/RecentChaptersPresenter.kt index 2f1a523f6..7e892db08 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/RecentChaptersPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/RecentChaptersPresenter.kt @@ -250,8 +250,7 @@ class RecentChaptersPresenter : BasePresenter() { * @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)) } /**