Remove GUI bootstraping from core/ (#5513)

This commit is contained in:
louib
2020-10-08 22:48:45 -04:00
committed by GitHub
parent fb87b1c794
commit 48d9fb3e79
12 changed files with 83 additions and 82 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 KeePassXC Team <team@keepassxc.org>
* Copyright (C) 2020 KeePassXC Team <team@keepassxc.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,7 +20,10 @@
#include "config-keepassx-tests.h"
#include "core/Bootstrap.h"
#include "core/Config.h"
#include "core/Entry.h"
#include "core/Global.h"
#include "core/Group.h"
#include "core/Metadata.h"
#include "core/Tools.h"
#include "crypto/Crypto.h"
#include "keys/drivers/YubiKey.h"
@@ -65,7 +68,7 @@ void TestCli::initTestCase()
QVERIFY(Crypto::init());
Config::createTempFileInstance();
Bootstrap::bootstrapApplication();
Bootstrap::bootstrap();
auto fd = new QFile();
#ifdef Q_OS_WIN

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
* Copyright (C) 2020 KeePassXC Team <team@keepassxc.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -39,7 +39,6 @@
#include <QToolButton>
#include "config-keepassx-tests.h"
#include "core/Bootstrap.h"
#include "core/Config.h"
#include "core/Database.h"
#include "core/Entry.h"
@@ -118,7 +117,7 @@ void TestGui::initTestCase()
// Disable the update check first time alert
config()->set(Config::UpdateCheckMessageShown, true);
Bootstrap::bootstrapApplication();
Application::bootstrap();
m_mainWindow.reset(new MainWindow());
m_tabWidget = m_mainWindow->findChild<DatabaseTabWidget*>("tabWidget");

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
* Copyright (C) 2019 KeePassXC Team <team@keepassxc.org>
* Copyright (C) 2020 KeePassXC Team <team@keepassxc.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,7 +33,6 @@
#include "browser/BrowserService.h"
#include "config-keepassx-tests.h"
#include "core/Bootstrap.h"
#include "core/Config.h"
#include "core/Database.h"
#include "core/Entry.h"
@@ -81,7 +80,6 @@ void TestGuiBrowser::initTestCase()
config()->set(Config::UpdateCheckMessageShown, true);
m_mainWindow.reset(new MainWindow());
Bootstrap::restoreMainWindowState(*m_mainWindow);
m_tabWidget = m_mainWindow->findChild<DatabaseTabWidget*>("tabWidget");
m_mainWindow->show();
}

View File

@@ -29,13 +29,14 @@
#include "TestGlobal.h"
#include "config-keepassx-tests.h"
#include "core/Bootstrap.h"
#include "core/Config.h"
#include "core/Tools.h"
#include "crypto/Crypto.h"
#include "gui/Application.h"
#include "gui/DatabaseTabWidget.h"
#include "gui/DatabaseWidget.h"
#include "gui/FileDialog.h"
#include "gui/MainWindow.h"
#include "gui/MessageBox.h"
#include "gui/wizard/NewDatabaseWizard.h"
#include "util/TemporaryFile.h"
@@ -195,7 +196,7 @@ void TestGuiFdoSecrets::initTestCase()
// activate within individual tests
FdoSecrets::settings()->setShowNotification(false);
Bootstrap::bootstrapApplication();
Application::bootstrap();
m_mainWindow.reset(new MainWindow());
m_tabWidget = m_mainWindow->findChild<DatabaseTabWidget*>("tabWidget");