You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CustomizePlus/Configuration/Services/ConfigurationMigrator.cs
+38-27Lines changed: 38 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -11,14 +11,15 @@
11
11
usingCustomizePlus.Configuration.Data;
12
12
usingCustomizePlus.Core.Events;
13
13
usingCustomizePlus.Configuration.Data.Version3;
14
+
usingCustomizePlus.UI.Windows;
14
15
15
16
namespaceCustomizePlus.Configuration.Services;
16
17
17
18
publicclassConfigurationMigrator
18
19
{
19
20
privatereadonlySaveService_saveService;
20
21
privatereadonlyBackupService_backupService;
21
-
privatereadonlyMessageService_messageService;
22
+
privatereadonlyMessageService_messageService;//we can't use popups here since they rely on PluginConfiguration and using them here hangs plugin loading
22
23
privatereadonlyLogger_logger;
23
24
privatereadonlyReloadEvent_reloadEvent;
24
25
@@ -54,9 +55,6 @@ public void Migrate(PluginConfiguration config)
54
55
MigrateV3ToV4();
55
56
// /V3 migration code
56
57
57
-
//I'm sorry, I'm too lazy so v3's enable root position setting is not getting migrated for now
58
-
//MigrateV3ToV4(configVersion);
59
-
60
58
config.Version=Constants.ConfigurationVersion;
61
59
_saveService.ImmediateSave(config);
62
60
}
@@ -67,41 +65,54 @@ private void MigrateV3ToV4()
67
65
68
66
//I'm sorry, I'm too lazy so v3's enable root position setting is not getting migrated
_logger.Debug($"Migrated v3 profile {legacyProfile.ProfileName} to profile {profile.UniqueId} and template {template.UniqueId}");
102
-
File.Delete(file);
103
+
_logger.Debug($"Migrated v3 profile {legacyProfile.ProfileName} to profile {profile.UniqueId} and template {template.UniqueId}");
104
+
File.Delete(file);
105
+
}
106
+
catch(Exceptionex)
107
+
{
108
+
anyMigrationFailures=true;
109
+
_logger.Error($"Error while migrating {file}: {ex}");
110
+
}
103
111
}
104
112
113
+
if(anyMigrationFailures)
114
+
_messageService.NotificationMessage($"Some of your Customize+ profiles failed to migrate correctly.\nDetails have been printed to Dalamud log (/xllog in chat).",NotificationType.Error);
0 commit comments