From 0ea288d3143a52b1ed6c78f3360d511b3981a4c1 Mon Sep 17 00:00:00 2001 From: s-ayush2903 Date: Sun, 13 Dec 2020 13:27:06 +0530 Subject: [PATCH] Removed libraryFactory --- .../nav/destination/library/LibraryFactory.kt | 26 ------------------- .../kiwixmobile/webserver/KiwixServer.kt | 7 +++-- 2 files changed, 3 insertions(+), 30 deletions(-) delete mode 100644 app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LibraryFactory.kt diff --git a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LibraryFactory.kt b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LibraryFactory.kt deleted file mode 100644 index 5f48b1ab2d..0000000000 --- a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LibraryFactory.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Kiwix Android - * Copyright (c) 2020 Kiwix - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package org.kiwix.kiwixmobile.nav.destination.library - -import org.kiwix.kiwixlib.Library -import javax.inject.Inject - -class LibraryFactory @Inject constructor() : Library() { - fun createKiwixLibrary(): Library = Library() -} diff --git a/app/src/main/java/org/kiwix/kiwixmobile/webserver/KiwixServer.kt b/app/src/main/java/org/kiwix/kiwixmobile/webserver/KiwixServer.kt index 61325f0dfa..c02d6c1519 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/webserver/KiwixServer.kt +++ b/app/src/main/java/org/kiwix/kiwixmobile/webserver/KiwixServer.kt @@ -21,16 +21,15 @@ package org.kiwix.kiwixmobile.webserver import android.util.Log import org.kiwix.kiwixlib.JNIKiwixException import org.kiwix.kiwixlib.JNIKiwixServer -import org.kiwix.kiwixmobile.nav.destination.library.LibraryFactory +import org.kiwix.kiwixlib.Library import javax.inject.Inject private const val TAG = "KiwixServer" -class KiwixServer @Inject constructor(kiwixLibraryFactory: LibraryFactory) { - private val libFactory = kiwixLibraryFactory +class KiwixServer @Inject constructor() { fun createKiwixServer(selectedBooksPath: ArrayList): JNIKiwixServer? { - val kiwixLibrary = libFactory.createKiwixLibrary() + val kiwixLibrary = Library() selectedBooksPath.forEach { path -> try { kiwixLibrary.addBook(path)