diff options
| author | Salanto <62221668+Salanto@users.noreply.github.com> | 2022-07-31 03:24:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-31 03:24:39 +0200 |
| commit | 14731a0fca83f3ce193ec03a19bc2f5fefe70c6c (patch) | |
| tree | 322c33822abc2c94d6b30bbeee687443b8337076 /src/text_file_functions.cpp | |
| parent | 091cd9d5c950dedfacf11452ba5d7410def529b9 (diff) | |
| parent | 786e782220b092a5a4ec497700ce803f49bdeec9 (diff) | |
Merge pull request #833 from AttorneyOnline/back-up-effects-ini
Auto-create a backup of the effects.ini before migration.
Diffstat (limited to 'src/text_file_functions.cpp')
| -rw-r--r-- | src/text_file_functions.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index c7cf8d0c..908bbce5 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -912,7 +912,13 @@ QStringList AOApplication::get_effects(QString p_char) // port legacy effects if (!l_effects_ini.contains("version/major") || l_effects_ini.value("version/major").toInt() < 2) { - AOUtils::migrateEffects(l_effects_ini); + QFile effects_old(i_filepath); + if (QFile::copy(i_filepath, i_filepath + ".old")) { + AOUtils::migrateEffects(l_effects_ini); + } + else { + qWarning() << "Unable to copy effects.ini, skipping migration."; + } } QStringList l_group_list; |
