mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Android: Replace log type names map with array
Storing the log type names in a map results in them getting re-sorted by their keys, which doesn't quite give us the sorting we want. In particular, the Achievements category ended up being sorted at R (for RetroAchivements) instead of at A. Every use of the map is just iterating through it, so there's no real reason why it has to be a map anyway.
This commit is contained in:
@ -12,6 +12,7 @@ import android.view.Surface;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.core.util.Pair;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import org.dolphinemu.dolphinemu.activities.EmulationActivity;
|
||||
@ -20,7 +21,6 @@ import org.dolphinemu.dolphinemu.utils.CompressCallback;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.concurrent.Semaphore;
|
||||
|
||||
/**
|
||||
@ -400,7 +400,7 @@ public final class NativeLibrary
|
||||
*/
|
||||
public static native void RefreshWiimotes();
|
||||
|
||||
public static native LinkedHashMap<String, String> GetLogTypeNames();
|
||||
public static native Pair<String, String>[] GetLogTypeNames();
|
||||
|
||||
public static native void ReloadLoggerConfig();
|
||||
|
||||
|
@ -1946,8 +1946,8 @@ class SettingsFragmentPresenter(
|
||||
) { SettingsAdapter.clearLog() })
|
||||
|
||||
sl.add(HeaderSetting(context, R.string.log_types, 0))
|
||||
for ((key, value) in LOG_TYPE_NAMES) {
|
||||
sl.add(LogSwitchSetting(key, value, ""))
|
||||
for (logType in LOG_TYPE_NAMES) {
|
||||
sl.add(LogSwitchSetting(logType.first, logType.second, ""))
|
||||
}
|
||||
}
|
||||
|
||||
@ -2468,11 +2468,11 @@ class SettingsFragmentPresenter(
|
||||
fun setAllLogTypes(value: Boolean) {
|
||||
val settings = fragmentView.settings
|
||||
|
||||
for ((key) in LOG_TYPE_NAMES) {
|
||||
for (logType in LOG_TYPE_NAMES) {
|
||||
AdHocBooleanSetting(
|
||||
Settings.FILE_LOGGER,
|
||||
Settings.SECTION_LOGGER_LOGS,
|
||||
key,
|
||||
logType.first,
|
||||
false
|
||||
).setBoolean(settings!!, value)
|
||||
}
|
||||
|
Reference in New Issue
Block a user