mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-12-06 12:43:35 +01:00
Android: Fix online system update after disc system update
This bug has been in Dolphin for a while now. If you installed a system update from a disc, attempting to do an online system update afterwards would result in Dolphin doing a disc update again because the disc path was never cleared.
This commit is contained in:
1 parent
a76221bc31
commit
c513c109fa
3 files changed
+15
-6
No files matched your search
+1
-1
@@ -24,7 +24,7 @@ class OnlineUpdateRegionSelectDialogFragment : DialogFragment() {
|
||||
.setSingleChoiceItems(items, checkedItem) { _: DialogInterface?, which: Int ->
|
||||
val viewModel =
|
||||
ViewModelProvider(requireActivity())[SystemUpdateViewModel::class.java]
|
||||
viewModel.region = which
|
||||
viewModel.prepareOnlineUpdate(which)
|
||||
SystemUpdateProgressBarDialogFragment().show(
|
||||
parentFragmentManager,
|
||||
SystemUpdateProgressBarDialogFragment.TAG
|
||||
|
||||
+12
-3
@@ -16,16 +16,25 @@ class SystemUpdateViewModel : ViewModel() {
|
||||
val totalData = MutableLiveData<Int>()
|
||||
val titleIdData = MutableLiveData<Long>()
|
||||
val resultData = MutableLiveData<Int>()
|
||||
|
||||
private var isRunning = false
|
||||
private var canceled = false
|
||||
var region = -1
|
||||
var discPath: String = ""
|
||||
private var region = -1
|
||||
private var discPath: String = ""
|
||||
|
||||
init {
|
||||
clear()
|
||||
}
|
||||
|
||||
fun prepareOnlineUpdate(region: Int) {
|
||||
this.region = region
|
||||
this.discPath = ""
|
||||
}
|
||||
|
||||
fun prepareDiscUpdate(discPath: String) {
|
||||
this.region = -1
|
||||
this.discPath = discPath
|
||||
}
|
||||
|
||||
fun setCanceled() {
|
||||
canceled = true
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ class MainPresenter(private val mainView: MainView, private val activity: Fragme
|
||||
private fun launchOnlineUpdate() {
|
||||
if (WiiUtils.isSystemMenuInstalled()) {
|
||||
val viewModel = ViewModelProvider(activity)[SystemUpdateViewModel::class.java]
|
||||
viewModel.region = -1
|
||||
viewModel.prepareOnlineUpdate(-1)
|
||||
launchUpdateProgressBarFragment(activity)
|
||||
} else {
|
||||
SystemMenuNotInstalledDialogFragment().show(
|
||||
@@ -357,7 +357,7 @@ class MainPresenter(private val mainView: MainView, private val activity: Fragme
|
||||
@JvmStatic
|
||||
fun launchDiscUpdate(path: String, activity: FragmentActivity) {
|
||||
val viewModel = ViewModelProvider(activity)[SystemUpdateViewModel::class.java]
|
||||
viewModel.discPath = path
|
||||
viewModel.prepareDiscUpdate(path)
|
||||
launchUpdateProgressBarFragment(activity)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user