рефакторинг. вынес в обобщенную часть бд, но еще не все
This commit is contained in:
@@ -2,6 +2,7 @@ package Visual_DVM_2021.Passes;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.DebugPrintLevel;
|
||||
import Common_old.UI.Menus_2023.PassButton;
|
||||
@@ -51,9 +52,9 @@ public class Pass_2021<T> {
|
||||
//важно. вызывать только если есть интерфейс.
|
||||
public static void CheckAllStats() throws Exception {
|
||||
for (Pass_2021 pass : FAPasses) {
|
||||
if (!Global.db.passStats.Data.containsKey(pass.code()))
|
||||
Global.db.Insert(pass.stats = new PassStats(pass));
|
||||
else pass.stats = Global.db.passStats.Data.get(pass.code());
|
||||
if (!((GlobalDatabase)CommonUtils.db).passStats.Data.containsKey(pass.code()))
|
||||
CommonUtils.db.Insert(pass.stats = new PassStats(pass));
|
||||
else pass.stats = ((GlobalDatabase)CommonUtils.db).passStats.Data.get(pass.code());
|
||||
}
|
||||
FAPasses.sort(new SortPassesByStats());
|
||||
}
|
||||
@@ -128,7 +129,7 @@ public class Pass_2021<T> {
|
||||
if (hasStats()) {
|
||||
stats.Inc();
|
||||
try {
|
||||
Global.db.Update(stats);
|
||||
CommonUtils.db.Update(stats);
|
||||
FAPasses.sort(new SortPassesByStats());
|
||||
if (Current.HasProject())
|
||||
UI.fastAccessMenuBar.Refresh();
|
||||
|
||||
Reference in New Issue
Block a user