chore: add miggrate qbytearray settings to qstring

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2025-05-21 00:31:41 +03:00
parent 7e174f53af
commit 89be378ef6
13 changed files with 44 additions and 37 deletions

View File

@@ -152,7 +152,14 @@ bool parseOldFileFormat(QIODevice& device, QSettings::SettingsMap& map)
QVariant migrateQByteArrayToBase64(QString key, QVariant value)
{
if (key.startsWith("WideBarVisibility_") || (key.startsWith("UI/") && key.endsWith("_Page/Columns"))) {
return value.toByteArray().toBase64();
return QString::fromUtf8(value.toByteArray().toBase64());
}
static const QStringList otherByteArrays = { "MainWindowState", "MainWindowGeometry", "ConsoleWindowState",
"ConsoleWindowGeometry", "PagedGeometry", "NewInstanceGeometry",
"ModDownloadGeometry", "RPDownloadGeometry", "TPDownloadGeometry",
"ShaderDownloadGeometry" };
if (otherByteArrays.contains(key)) {
return QString::fromUtf8(value.toByteArray());
}
return value;
}