Skip to content

Commit a107278

Browse files
committed
Run CodeMaid. Add quick Keys.txt check.
1 parent 01002f4 commit a107278

5 files changed

Lines changed: 490 additions & 511 deletions

File tree

SwitchGameManager/Helpers/FileHelper.cs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,9 @@ public static class FileHelper
1616
private static BackgroundWorker transferWorker;
1717
private static List<XciItem> xciTransfers = new List<XciItem>();
1818

19-
public struct FileStruct
20-
{
21-
public FileAction action;
22-
public string destinationPath;
23-
public string sourcePath;
24-
public XciHelper.XciLocation source;
25-
public XciHelper.XciLocation destination;
26-
public bool actionCompleted;
27-
public bool actionSuccess;
28-
}
19+
public static formMain formMain;
20+
21+
public static bool isTransferInProgress;
2922

3023
public enum FileAction
3124
{
@@ -41,8 +34,16 @@ public enum FileAction
4134
ShowRenameWindow
4235
}
4336

44-
public static formMain formMain;
45-
public static bool isTransferInProgress;
37+
public struct FileStruct
38+
{
39+
public FileAction action;
40+
public bool actionCompleted;
41+
public bool actionSuccess;
42+
public XciHelper.XciLocation destination;
43+
public string destinationPath;
44+
public XciHelper.XciLocation source;
45+
public string sourcePath;
46+
}
4647

4748
private static void CustomCopy_OnComplete(bool Canceled)
4849
{
@@ -79,7 +80,7 @@ private static void TransferWorker_DoWork(object sender, DoWorkEventArgs e)
7980
customCopy.Copy();
8081

8182
transferredFiles++;
82-
83+
8384
lock (lockObject)
8485
xciTransfers.Remove(xciAction);
8586

@@ -118,12 +119,6 @@ private static void TransferWorker_RunWorkerCompleted(object sender, RunWorkerCo
118119
//XciHelper.LoadXcis();
119120
}
120121

121-
public static void StopTransfers()
122-
{
123-
if (transferWorker.IsBusy)
124-
transferWorker.CancelAsync();
125-
}
126-
127122
public static bool IsXciInTransferList(XciItem xci)
128123
{
129124
lock (lockObject)
@@ -135,9 +130,14 @@ public static bool IsXciInTransferList(XciItem xci)
135130
return false;
136131
}
137132

138-
public static bool TransferXci(XciItem xci)
133+
public static void StopTransfers()
139134
{
135+
if (transferWorker.IsBusy)
136+
transferWorker.CancelAsync();
137+
}
140138

139+
public static bool TransferXci(XciItem xci)
140+
{
141141
if (xci.fileAction.action != FileAction.Copy &&
142142
xci.fileAction.action != FileAction.Move)
143143
return false;
@@ -166,7 +166,6 @@ public static bool TransferXci(XciItem xci)
166166
else
167167
xci.fileAction.destinationPath = Path.Combine(Settings.config.sdDriveLetter, Path.GetFileName(xci.fileAction.sourcePath));
168168

169-
170169
if (String.IsNullOrWhiteSpace(xci.fileAction.sourcePath) || String.IsNullOrWhiteSpace(xci.fileAction.destinationPath))
171170
return false;
172171

SwitchGameManager/Helpers/Settings.cs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace SwitchGameManager.Helpers
99
{
1010
public class Config
1111
{
12-
12+
public XciHelper.XciLocation defaultView;
1313

1414
//public bool confirmMultiActions;
1515
public bool encryptCertificates;
@@ -21,22 +21,24 @@ public class Config
2121
public int formWidth = 975;
2222
public int listIconSize = 1;
2323
public List<string> localXciFolders = new List<string>();
24-
public string sdDriveLetter = string.Empty;
2524
public byte[] olvState;
26-
public XciHelper.XciLocation defaultView;
27-
25+
public string sdDriveLetter = string.Empty;
2826
//public bool lowMemoryMode = false; //Reduce memory usage at cost of slower UI updates (stop caching info, etc)
2927
}
3028

3129
public class Settings
3230
{
33-
public static Config config;
34-
3531
public static string cacheFileName = "Cache.json";
36-
32+
public static Config config;
3733
public static string configFileName = "Config.json";
3834

39-
35+
public static bool CheckForSdCard()
36+
{
37+
if (!string.IsNullOrWhiteSpace(config.sdDriveLetter) && Directory.Exists(config.sdDriveLetter))
38+
return true;
39+
else
40+
return false;
41+
}
4042

4143
public static bool LoadSettings(string fileName = "")
4244
{
@@ -57,14 +59,6 @@ public static bool LoadSettings(string fileName = "")
5759
return false;
5860
}
5961

60-
public static bool CheckForSdCard()
61-
{
62-
if (!string.IsNullOrWhiteSpace(config.sdDriveLetter) && Directory.Exists(config.sdDriveLetter))
63-
return true;
64-
else
65-
return false;
66-
}
67-
6862
public static bool SaveSettings(string fileName = "")
6963
{
7064
try

0 commit comments

Comments
 (0)