From 97f0f418d6a47a7fed4f91fccbe59baf18e29b02 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 4 Sep 2017 22:27:55 -0700 Subject: [PATCH] Enable auto-bak loading for db previously was only for debug builds; loads in like 2 seconds on my computer for >70k pkm from >250 backups if enough people complain I can add it as a setting instead --- PKHeX.WinForms/Subforms/SAV_Database.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PKHeX.WinForms/Subforms/SAV_Database.cs b/PKHeX.WinForms/Subforms/SAV_Database.cs index 9c67d321e..977ff5376 100644 --- a/PKHeX.WinForms/Subforms/SAV_Database.cs +++ b/PKHeX.WinForms/Subforms/SAV_Database.cs @@ -1,4 +1,5 @@ -using System; +#define LOADALL +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; @@ -157,7 +158,7 @@ private void ClickDelete(object sender, EventArgs e) var pk = Results[index]; string path = pk.Identifier; -#if DEBUG +#if LOADALL if (path.StartsWith(EXTERNAL_SAV)) { WinFormsUtil.Alert("Can't delete from a backup save."); @@ -338,7 +339,7 @@ private void LoadDatabase() dbTemp.Add(pk); }); -#if DEBUG +#if LOADALL if (SaveUtil.GetSavesFromFolder(Main.BackupPath, false, out IEnumerable result)) { Parallel.ForEach(result, file => @@ -405,7 +406,7 @@ private IEnumerable SearchDatabase() if (!Menu_SearchDatabase.Checked) { res = res.Where(pk => !pk.Identifier.StartsWith(DatabasePath + Path.DirectorySeparatorChar, StringComparison.Ordinal)); -#if DEBUG +#if LOADALL res = res.Where(pk => !pk.Identifier.StartsWith(EXTERNAL_SAV, StringComparison.Ordinal)); #endif }