diff options
author | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2019-10-02 22:45:53 +0200 |
---|---|---|
committer | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2019-10-02 22:52:04 +0200 |
commit | 3454fcf68288b9bd67ce624e591a60d5d2758610 (patch) | |
tree | dff13d0ce4484da7b0194f057029b063b1efff68 /src/qtpass.cpp | |
parent | fc2aed35a9eae1ecede54321fd0644f89f9bd3c3 (diff) |
Don't call QtPass::setup() from QtPass class constructor
QtPass::setup() cannot be called from this class constructor as it
possibly calls back MainWindow::config() method.
QtPass constructor is in turn called from the MainWindow one so the
MainWindow object might not be fully constructed yet.
It looks like this was introduced in commit bc19f9eeb5bbcd.
Rename QtPass::setup() to QtPass::init() and call it explicitly at the end
of the MainWindow constructor.
Should fix https://github.com/IJHack/QtPass/issues/466, but the whole thing
really needs a refactoring to establish a clear QtPass -> MainWindow (or
MainWindow -> QtPass) relationship and to make sure there aren't any
circular dependencies there (and other similar bugs).
Diffstat (limited to 'src/qtpass.cpp')
-rw-r--r-- | src/qtpass.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/qtpass.cpp b/src/qtpass.cpp index 8d90d370..22366c06 100644 --- a/src/qtpass.cpp +++ b/src/qtpass.cpp @@ -25,12 +25,6 @@ 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(); - {} - } - setClipboardTimer(); clearClipboardTimer.setSingleShot(true); connect(&clearClipboardTimer, SIGNAL(timeout()), this, @@ -59,10 +53,10 @@ QtPass::~QtPass() { } /** - * @brief QtPass::setup make sure we are ready to go as soon as + * @brief QtPass::init make sure we are ready to go as soon as * possible */ -bool QtPass::setup() { +bool QtPass::init() { QString passStore = QtPassSettings::getPassStore(Util::findPasswordStore()); QtPassSettings::setPassStore(passStore); |