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:
baldurk
2017-04-06 14:09:00 +01:00
parent 71e779a08f
commit d40fc8471d
158 changed files with 6386 additions and 6176 deletions
+7 -7
View File
@@ -426,7 +426,7 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
rdctype::str driver;
rdctype::str machineIdent;
ReplaySupport support = eReplaySupport_Unsupported;
ReplaySupport support = ReplaySupport::Unsupported;
bool remoteReplay = !local || (m_Ctx.Renderer().remote() && m_Ctx.Renderer().remote()->Connected);
@@ -437,7 +437,7 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
// if the return value suggests remote replay, and it's not already selected, AND the user
// hasn't previously chosen to always replay locally without being prompted, ask if they'd
// prefer to switch to a remote context for replaying.
if(support == eReplaySupport_SuggestRemote && !remoteReplay && !m_Ctx.Config.AlwaysReplayLocally)
if(support == ReplaySupport::SuggestRemote && !remoteReplay && !m_Ctx.Config.AlwaysReplayLocally)
{
SuggestRemoteDialog dialog(ToQStr(driver), ToQStr(machineIdent), this);
@@ -493,14 +493,14 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
if(remoteReplay)
{
support = eReplaySupport_Unsupported;
support = ReplaySupport::Unsupported;
QStringList remoteDrivers = m_Ctx.Renderer().GetRemoteSupport();
for(const QString &d : remoteDrivers)
{
if(driver == d)
support = eReplaySupport_Supported;
support = ReplaySupport::Supported;
}
}
}
@@ -509,7 +509,7 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
// if driver is empty something went wrong loading the log, let it be handled as usual
// below. Otherwise indicate that support is missing.
if(driver.count > 0 && support == eReplaySupport_Unsupported)
if(driver.count > 0 && support == ReplaySupport::Unsupported)
{
if(remoteReplay)
{
@@ -1153,7 +1153,7 @@ void MainWindow::switchContext()
host->CheckStatus();
}
ReplayCreateStatus status = eReplayCreate_Success;
ReplayStatus status = ReplayStatus::Succeeded;
if(host->ServerRunning && !host->Busy)
{
@@ -1164,7 +1164,7 @@ void MainWindow::switchContext()
contextChooser->setIcon(host->ServerRunning && !host->Busy ? Icons::connect()
: Icons::disconnect());
if(status != eReplayCreate_Success)
if(status != ReplayStatus::Succeeded)
{
contextChooser->setIcon(Icons::cross());
contextChooser->setText(tr("Replay Context: %1").arg("Local"));