refactor: MainWindow remove need created / onCreated methods
This commit is contained in:
@ -116,8 +116,17 @@ MainWindow::MainWindow(ConfigScopes &configScopes, AppConfig &appConfig)
|
||||
setupControls();
|
||||
connectSlots();
|
||||
|
||||
// handled by `onCreated`
|
||||
Q_EMIT created();
|
||||
setIcon();
|
||||
|
||||
m_ConfigScopes.signalReady();
|
||||
|
||||
applyCloseToTray();
|
||||
|
||||
updateScreenName();
|
||||
applyConfig();
|
||||
restoreWindow();
|
||||
|
||||
qDebug().noquote() << "active settings path:" << m_ConfigScopes.activeFilePath();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
@ -220,8 +229,6 @@ void MainWindow::connectSlots()
|
||||
[this](const QString &line) { handleLogLine(line); }
|
||||
);
|
||||
|
||||
connect(this, &MainWindow::created, this, &MainWindow::onCreated);
|
||||
|
||||
connect(this, &MainWindow::shown, this, &MainWindow::onShown, Qt::QueuedConnection);
|
||||
|
||||
connect(&m_ConfigScopes, &ConfigScopes::saving, this, &MainWindow::onConfigScopesSaving, Qt::DirectConnection);
|
||||
@ -308,22 +315,6 @@ void MainWindow::onAppAboutToQuit()
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onCreated()
|
||||
{
|
||||
|
||||
setIcon();
|
||||
|
||||
m_ConfigScopes.signalReady();
|
||||
|
||||
applyCloseToTray();
|
||||
|
||||
updateScreenName();
|
||||
applyConfig();
|
||||
restoreWindow();
|
||||
|
||||
qDebug().noquote() << "active settings path:" << m_ConfigScopes.activeFilePath();
|
||||
}
|
||||
|
||||
void MainWindow::onShown()
|
||||
{
|
||||
// if a critical error was shown just before the main window (i.e. on app
|
||||
|
||||
@ -95,7 +95,6 @@ public:
|
||||
void autoAddScreen(const QString name);
|
||||
|
||||
signals:
|
||||
void created();
|
||||
void shown();
|
||||
|
||||
public slots:
|
||||
@ -105,7 +104,6 @@ private slots:
|
||||
//
|
||||
// Manual slots
|
||||
//
|
||||
void onCreated();
|
||||
void onShown();
|
||||
void onConfigScopesSaving();
|
||||
void onAppConfigTlsChanged();
|
||||
|
||||
Reference in New Issue
Block a user