refactor: use QList for the tray's Action List

This commit is contained in:
sithlord48 2024-12-17 17:21:14 -05:00 committed by Chris Rizzitello
parent 8aec0dd5bb
commit ebad12a922
3 changed files with 4 additions and 5 deletions

View file

@ -522,10 +522,9 @@ void MainWindow::moveEvent(QMoveEvent *event)
void MainWindow::open()
{
QList<QAction *> trayActions{ui->m_pActionStartCore, ui->m_pActionStopCore, nullptr, ui->m_pActionQuit};
std::vector<QAction *> trayMenu = {ui->m_pActionStartCore, ui->m_pActionStopCore, nullptr, ui->m_pActionQuit};
m_TrayIcon.create(trayMenu);
m_TrayIcon.create(trayActions);
if (m_AppConfig.autoHide()) {
hide();

View file

@ -51,7 +51,7 @@ void TrayIcon::showRetryLoop()
}
}
void TrayIcon::create(std::vector<QAction *> const &actions)
void TrayIcon::create(const QList<QAction *> &actions)
{
m_pTrayIconMenu = std::make_unique<QMenu>();

View file

@ -32,7 +32,7 @@ class TrayIcon : public QObject
public:
explicit TrayIcon() = default;
void create(std::vector<QAction *> const &actions);
void create(const QList<QAction *> &actions);
void setIcon(const QIcon &icon);
signals: