mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Change API enums to enum class, remove now redundant prefixing
* This gives a little nicer syntax, a bit better type safety, and also reflects better for SWIG bindings. Overall it's a minor change but better. * We don't update the C# UI at all, since it's soon to be removed and not worth the effort/code churn. * For now so we're ABI compatible with C#, all enums are uint32_t, but that is an obvious optimisation in future to reduce struct packing. * We avoid 'None' as an enum value, because it's a reserved word in python so will cause problems generating bindings.
This commit is contained in:
@@ -51,7 +51,8 @@ EnvironmentEditor::EnvironmentEditor(QWidget *parent)
|
||||
QObject::connect(ui->appendValue, &QRadioButton::toggled, separatorLambda);
|
||||
|
||||
ui->separator->addItems({
|
||||
ToQStr(eEnvSep_Platform), ToQStr(eEnvSep_SemiColon), ToQStr(eEnvSep_Colon), ToQStr(eEnvSep_None),
|
||||
ToQStr(EnvSep::Platform), ToQStr(EnvSep::SemiColon), ToQStr(EnvSep::Colon),
|
||||
ToQStr(EnvSep::NoSep),
|
||||
});
|
||||
|
||||
ui->separator->setCurrentIndex(0);
|
||||
@@ -120,11 +121,11 @@ void EnvironmentEditor::on_variables_currentItemChanged(QTreeWidgetItem *current
|
||||
ui->value->setText(mod.value);
|
||||
ui->separator->setCurrentIndex((int)mod.separator);
|
||||
|
||||
if(mod.type == eEnvMod_Set)
|
||||
if(mod.type == EnvMod::Set)
|
||||
ui->setValue->setChecked(true);
|
||||
else if(mod.type == eEnvMod_Append)
|
||||
else if(mod.type == EnvMod::Append)
|
||||
ui->appendValue->setChecked(true);
|
||||
else if(mod.type == eEnvMod_Prepend)
|
||||
else if(mod.type == EnvMod::Prepend)
|
||||
ui->prependValue->setChecked(true);
|
||||
}
|
||||
}
|
||||
@@ -134,14 +135,14 @@ void EnvironmentEditor::on_addUpdate_clicked()
|
||||
EnvironmentModification mod;
|
||||
mod.variable = ui->name->text();
|
||||
mod.value = ui->value->text();
|
||||
mod.separator = (EnvironmentSeparator)ui->separator->currentIndex();
|
||||
mod.separator = (EnvSep)ui->separator->currentIndex();
|
||||
|
||||
if(ui->appendValue->isChecked())
|
||||
mod.type = eEnvMod_Append;
|
||||
mod.type = EnvMod::Append;
|
||||
else if(ui->prependValue->isChecked())
|
||||
mod.type = eEnvMod_Prepend;
|
||||
mod.type = EnvMod::Prepend;
|
||||
else
|
||||
mod.type = eEnvMod_Set;
|
||||
mod.type = EnvMod::Set;
|
||||
|
||||
addModification(mod, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user