mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-09-19 22:57:45 +03:00
Use constant instead of hard-coded literals for number of available account types
This commit is contained in:
parent
94e466afd7
commit
ce8e66e829
@ -26,6 +26,7 @@ class Account : public QObject {
|
||||
|
||||
public:
|
||||
enum Kind { GitHub, Bitbucket, Beanstalk, GitLab, Gitea };
|
||||
static const int NUM_KINDS = 5;
|
||||
|
||||
struct Comment {
|
||||
QString body;
|
||||
|
@ -743,7 +743,7 @@ SideBar::SideBar(TabWidget *tabs, QWidget *parent) : QWidget(parent) {
|
||||
|
||||
plusMenu->addSeparator();
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
for (int i = 0; i < Account::NUM_KINDS; ++i) {
|
||||
Account::Kind kind = static_cast<Account::Kind>(i);
|
||||
QString text = tr("Add %1 Account").arg(Account::name(kind));
|
||||
QAction *add = plusMenu->addAction(text);
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
layout->addWidget(init);
|
||||
layout->addWidget(addSeparator());
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
for (int i = 0; i < Account::NUM_KINDS; ++i) {
|
||||
Account::Kind kind = static_cast<Account::Kind>(i);
|
||||
QString text = tr("Add %1 account").arg(Account::name(kind));
|
||||
QPushButton *account = addButton(Account::icon(kind), text);
|
||||
|
Loading…
Reference in New Issue
Block a user