diff options
author | fanquake <fanquake@gmail.com> | 2019-10-15 15:53:12 -0400 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2019-10-15 15:53:22 -0400 |
commit | eb292af309aa57f3d7998b01307dd4cb91702908 (patch) | |
tree | 34eba0b06eff930208ffcdb61f9f6daf4bd172f0 /src/qt/rpcconsole.cpp | |
parent | a3af5b5c13f7334f1874f77c4d1e9052fc705e22 (diff) | |
parent | 8019b6b150ff7444195a238470414c9deec5bf74 (diff) |
Merge #17105: gui: Make RPCConsole::TabTypes an enum class
8019b6b150ff7444195a238470414c9deec5bf74 gui: Make RPCConsole::TabTypes an enum class (João Barbosa)
Pull request description:
This change makes the compiler emit a warning/error if a missing enum value is not handled. See also #17134.
ACKs for top commit:
MarcoFalke:
unsigned ACK 8019b6b150ff7444195a238470414c9deec5bf74
hebasto:
re-ACK 8019b6b150ff7444195a238470414c9deec5bf74
fanquake:
ACK 8019b6b150ff7444195a238470414c9deec5bf74
Tree-SHA512: 329161097f4d079f48d5fb33bf3a07e314fbb2ac325cafb08bafa9e76229ecff0f9010fe3c1c15ccd02d4539b5c93839c846b42bfeaffa897a917cea599bf811
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r-- | src/qt/rpcconsole.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 4f6629bfe1..3dd64c5273 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -1268,22 +1268,24 @@ void RPCConsole::showOrHideBanTableIfRequired() void RPCConsole::setTabFocus(enum TabTypes tabType) { - ui->tabWidget->setCurrentIndex(tabType); + ui->tabWidget->setCurrentIndex(int(tabType)); } QString RPCConsole::tabTitle(TabTypes tab_type) const { - return ui->tabWidget->tabText(tab_type); + return ui->tabWidget->tabText(int(tab_type)); } QKeySequence RPCConsole::tabShortcut(TabTypes tab_type) const { switch (tab_type) { - case TAB_INFO: return QKeySequence(Qt::CTRL + Qt::Key_I); - case TAB_CONSOLE: return QKeySequence(Qt::CTRL + Qt::Key_T); - case TAB_GRAPH: return QKeySequence(Qt::CTRL + Qt::Key_N); - case TAB_PEERS: return QKeySequence(Qt::CTRL + Qt::Key_P); - } + case TabTypes::INFO: return QKeySequence(Qt::CTRL + Qt::Key_I); + case TabTypes::CONSOLE: return QKeySequence(Qt::CTRL + Qt::Key_T); + case TabTypes::GRAPH: return QKeySequence(Qt::CTRL + Qt::Key_N); + case TabTypes::PEERS: return QKeySequence(Qt::CTRL + Qt::Key_P); + } // no default case, so the compiler can warn about missing cases + + assert(false); } void RPCConsole::updateAlerts(const QString& warnings) |