diff options
author | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2019-10-02 22:33:02 +0200 |
---|---|---|
committer | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2019-10-02 22:51:58 +0200 |
commit | fc2aed35a9eae1ecede54321fd0644f89f9bd3c3 (patch) | |
tree | c58e408f2aaa70244d6e7de29e384ec189b486b2 /src/qtpass.cpp | |
parent | 397ca5b3de3b332885602054800ea6dd3b45e1e8 (diff) |
Make QtPass class constructor take a MainWindow object directly
The QtPass class is not usable without a MainWindow object so it can as
well take it directly as its constructor parameter.
Diffstat (limited to 'src/qtpass.cpp')
-rw-r--r-- | src/qtpass.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qtpass.cpp b/src/qtpass.cpp index 1c207052..8d90d370 100644 --- a/src/qtpass.cpp +++ b/src/qtpass.cpp @@ -22,7 +22,9 @@ #include "debughelper.h" #endif -QtPass::QtPass() : clippedText(QString()), freshStart(true) { +QtPass::QtPass(MainWindow *mainWindow) : m_mainWindow(mainWindow), + clippedText(QString()), + freshStart(true) { if (!setup()) { // no working config so this should quit without config anything QApplication::quit(); @@ -36,6 +38,8 @@ QtPass::QtPass() : clippedText(QString()), freshStart(true) { QObject::connect(qApp, &QApplication::aboutToQuit, this, &QtPass::clearClipboard); + + setMainWindow(); } /** @@ -111,8 +115,7 @@ bool QtPass::setup() { return true; } -void QtPass::setMainWindow(MainWindow *mW) { - m_mainWindow = mW; +void QtPass::setMainWindow(void) { m_mainWindow->restoreWindow(); fusedav.setParent(m_mainWindow); |