8
8
using System . Runtime . InteropServices ;
9
9
using System . Windows . Forms ;
10
10
using Application = System . Windows . Forms . Application ;
11
+ using Bluegrams . Application ;
11
12
using BrightIdeasSoftware ;
12
13
using LibHac ;
13
14
using FsTitle = LibHac . Title ;
14
15
using Title = NX_Game_Info . Common . Title ;
15
- using Bluegrams . Application ;
16
16
17
17
#pragma warning disable IDE1006 // Naming rule violation: These words must begin with upper case characters
18
18
@@ -39,10 +39,10 @@ public Main()
39
39
40
40
PortableSettingsProvider . SettingsFileName = Common . USER_SETTINGS ;
41
41
PortableSettingsProviderBase . SettingsDirectory = Process . path_prefix ;
42
- PortableSettingsProvider . ApplyProvider ( Common . Settings . Default , Common . Cache . Default ) ;
42
+ PortableSettingsProvider . ApplyProvider ( Common . Settings . Default , Common . History . Default ) ;
43
43
44
44
Common . Settings . Default . Upgrade ( ) ;
45
- Common . Cache . Default . Upgrade ( ) ;
45
+ Common . History . Default . Upgrade ( ) ;
46
46
47
47
debugLogToolStripMenuItem . Checked = Common . Settings . Default . DebugLog ;
48
48
@@ -60,26 +60,11 @@ public Main()
60
60
Environment . Exit ( - 1 ) ;
61
61
}
62
62
63
- titles = Common . Cache . Default . Titles . LastOrDefault ( ) ? . ToList ( ) ?? titles ;
64
-
65
- foreach ( var title in titles )
66
- {
67
- string titleID = title . type == TitleType . AddOnContent ? title . titleID : title . titleIDApplication ;
68
-
69
- if ( Process . latestVersions . TryGetValue ( titleID , out uint version ) )
70
- {
71
- if ( title . version > version )
72
- {
73
- Process . latestVersions [ titleID ] = title . version ;
74
- }
75
- }
76
- else
77
- {
78
- Process . latestVersions . Add ( titleID , title . version ) ;
79
- }
80
- }
63
+ titles = Process . processHistory ( ) ;
81
64
82
65
reloadData ( ) ;
66
+
67
+ toolStripStatusLabel . Text = String . Format ( "{0} files" , titles . Count ) ;
83
68
}
84
69
85
70
public void reloadData ( )
@@ -355,12 +340,12 @@ private void updateVersionListToolStripMenuItem_Click(object sender, EventArgs e
355
340
{
356
341
reloadData ( ) ;
357
342
358
- Common . Cache . Default . Titles . Add ( titles . ToList ( ) ) ;
359
- if ( Common . Cache . Default . Titles . Count > Common . CACHE_SIZE )
343
+ Common . History . Default . Titles . Add ( titles . ToList ( ) ) ;
344
+ if ( Common . History . Default . Titles . Count > Common . HISTORY_SIZE )
360
345
{
361
- Common . Cache . Default . Titles . RemoveRange ( 0 , Common . Cache . Default . Titles . Count - Common . CACHE_SIZE ) ;
346
+ Common . History . Default . Titles . RemoveRange ( 0 , Common . History . Default . Titles . Count - Common . HISTORY_SIZE ) ;
362
347
}
363
- Common . Cache . Default . Save ( ) ;
348
+ Common . History . Default . Save ( ) ;
364
349
}
365
350
366
351
Process . log ? . WriteLine ( "\n {0} titles have updated version" , count ) ;
@@ -550,12 +535,12 @@ private void backgroundWorkerProcess_RunWorkerCompleted(object sender, System.Co
550
535
{
551
536
reloadData ( ) ;
552
537
553
- Common . Cache . Default . Titles . Add ( titles . ToList ( ) ) ;
554
- if ( Common . Cache . Default . Titles . Count > Common . CACHE_SIZE )
538
+ Common . History . Default . Titles . Add ( titles . ToList ( ) ) ;
539
+ if ( Common . History . Default . Titles . Count > Common . HISTORY_SIZE )
555
540
{
556
- Common . Cache . Default . Titles . RemoveRange ( 0 , Common . Cache . Default . Titles . Count - Common . CACHE_SIZE ) ;
541
+ Common . History . Default . Titles . RemoveRange ( 0 , Common . History . Default . Titles . Count - Common . HISTORY_SIZE ) ;
557
542
}
558
- Common . Cache . Default . Save ( ) ;
543
+ Common . History . Default . Save ( ) ;
559
544
560
545
toolStripStatusLabel . Text = String . Format ( "{0} files" , titles . Count ) ;
561
546
0 commit comments