Update r2 to 4.5 and fix renamed configuration variables. (#2288)

This commit is contained in:
karliss 2020-07-20 15:47:48 +03:00 committed by GitHub
parent d964594498
commit e14d0d8ef6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 8 deletions

View File

@ -81,6 +81,10 @@ matrix:
osx_image: xcode11
env: BUILD_SYSTEM=cmake
before_install: ~
addons:
homebrew:
brewfile: scripts/Brewfile
update: true # updating brew to get slightly newer meson, 0.54 doesn't work on macOS.
- name: Documentation + Deploy
os: linux

@ -1 +1 @@
Subproject commit 4c9bf99134bccb8a1f23b2753efffad4bc090388
Subproject commit 9d7eda5ec7367d1682e489e92d1be8e37e459296

View File

@ -115,7 +115,7 @@ static const QHash<QString, QVariant> asmOptions = {
{ "asm.var.summary", false },
{ "asm.bytes", false },
{ "asm.size", false },
{ "asm.bytespace", false },
{ "asm.bytes.space", false },
{ "asm.lbytes", true },
{ "asm.nbytes", 10 },
{ "asm.syntax", "intel" },
@ -123,7 +123,7 @@ static const QHash<QString, QVariant> asmOptions = {
{ "asm.bb.line", false },
{ "asm.capitalize", false },
{ "asm.var.sub", true },
{ "asm.var.subonly", true },
{ "asm.sub.varonly", true },
{ "asm.tabs", 8 },
{ "asm.tabs.off", 5 },
{ "asm.marks", false },

View File

@ -28,7 +28,7 @@ static bool migrateSettingsPre18(QSettings &newSettings)
return true;
}
#define CUTTER_SETTINGS_VERSION_CURRENT 3
#define CUTTER_SETTINGS_VERSION_CURRENT 4
#define CUTTER_SETTINGS_VERSION_KEY "version"
/*
@ -103,6 +103,18 @@ static void migrateSettingsTo3(QSettings &settings) {
settings.remove("unsync");
}
static void migrateSettingsTo4(QSettings &settings) {
auto renameAsmOption = [&](QString oldName, QString newName) {
if (settings.contains(oldName)) {
auto value = settings.value(oldName);
settings.remove(oldName);
settings.setValue(newName, value);
}
};
renameAsmOption("asm.var.subonly", "asm.sub.varonly");
renameAsmOption("asm.bytespace", "asm.bytes.space");
}
void Cutter::initializeSettings()
{
QSettings::setDefaultFormat(QSettings::IniFormat);
@ -126,6 +138,8 @@ void Cutter::initializeSettings()
migrateSettingsTo2(settings); break;
case 3:
migrateSettingsTo3(settings); break;
case 4:
migrateSettingsTo4(settings); break;
default:
break;
}

View File

@ -27,9 +27,9 @@ AsmOptionsWidget::AsmOptionsWidget(PreferencesDialog *dialog)
{ ui->xrefCheckBox, "asm.xrefs" },
{ ui->bblineCheckBox, "asm.bb.line" },
{ ui->varsubCheckBox, "asm.var.sub" },
{ ui->varsubOnlyCheckBox, "asm.var.subonly" },
{ ui->varsubOnlyCheckBox, "asm.sub.varonly" },
{ ui->lbytesCheckBox, "asm.lbytes" },
{ ui->bytespaceCheckBox, "asm.bytespace" },
{ ui->bytespaceCheckBox, "asm.bytes.space" },
{ ui->bytesCheckBox, "asm.bytes" },
{ ui->xrefCheckBox, "asm.xrefs" },
{ ui->indentCheckBox, "asm.indent" },

View File

@ -220,7 +220,7 @@
<item row="19" column="1" colspan="2">
<widget class="QCheckBox" name="bytespaceCheckBox">
<property name="text">
<string>Separate bytes with whitespace (asm.bytespace)</string>
<string>Separate bytes with whitespace (asm.bytes.space)</string>
</property>
</widget>
</item>
@ -479,7 +479,7 @@
<item>
<widget class="QCheckBox" name="varsubOnlyCheckBox">
<property name="text">
<string>Substitute entire variable expressions with names (asm.var.subonly)</string>
<string>Substitute entire variable expressions with names (asm.sub.varonly)</string>
</property>
</widget>
</item>