@ -501,8 +501,6 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
var errorBaseGame = 0
var errorExtension = 0
var errorOther = 0
var errorTotal = 0
lifecycleScope . launch {
documents . forEach {
when ( NativeLibrary . installFileToNand ( it . toString ( ) ) ) {
NativeLibrary . InstallFileToNandResult . Success -> {
@ -526,7 +524,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
}
}
}
withContext ( Dispatchers . Main ) {
val separator = System . getProperty ( " line.separator " ) ?: " \n "
val installResult = StringBuilder ( )
if ( installSuccess > 0 ) {
@ -547,7 +545,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
)
installResult . append ( separator )
}
errorTotal = errorBaseGame + errorExtension + errorOther
val errorTotal : Int = errorBaseGame + errorExtension + errorOther
if ( errorTotal > 0 ) {
installResult . append ( separator )
installResult . append (
@ -577,20 +575,17 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
)
installResult . append ( separator )
}
MessageDialogFragment . newInstance (
return @newInstance MessageDialogFragment . newInstance (
titleId = R . string . install _game _content _failure ,
descriptionString = installResult . toString ( ) . trim ( ) ,
helpLinkId = R . string . install _game _content _help _link
) . show ( supportFragmentManager , MessageDialogFragment . TAG )
)
} else {
MessageDialogFragment . newInstance (
return @newInstance MessageDialogFragment . newInstance (
titleId = R . string . install _game _content _success ,
descriptionString = installResult . toString ( ) . trim ( )
) . show ( supportFragmentManager , MessageDialogFragment . TAG )
)
}
}
}
return @newInstance installSuccess + installOverwrite + errorTotal
} . show ( supportFragmentManager , IndeterminateProgressDialogFragment . TAG )
}
}