mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 13:51:05 +02:00
qt: Avoid header circular dependency
This commit is contained in:
committed by
Hennadii Stepanov
parent
25884bd896
commit
3a03f07560
@@ -5,7 +5,6 @@
|
||||
#include <qt/freespacechecker.h>
|
||||
|
||||
#include <qt/guiutil.h>
|
||||
#include <qt/intro.h>
|
||||
#include <util/fs.h>
|
||||
|
||||
#include <QDir>
|
||||
@@ -13,11 +12,6 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
FreespaceChecker::FreespaceChecker(Intro *_intro)
|
||||
{
|
||||
this->intro = _intro;
|
||||
}
|
||||
|
||||
void FreespaceChecker::check()
|
||||
{
|
||||
QString dataDirStr = intro->getPathToCheck();
|
||||
|
@@ -9,8 +9,6 @@
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
class Intro;
|
||||
|
||||
/* Check free space asynchronously to prevent hanging the UI thread.
|
||||
|
||||
Up to one request to check a path is in flight to this thread; when the check()
|
||||
@@ -26,7 +24,13 @@ class FreespaceChecker : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FreespaceChecker(Intro *intro);
|
||||
class PathQuery
|
||||
{
|
||||
public:
|
||||
virtual QString getPathToCheck() = 0;
|
||||
};
|
||||
|
||||
explicit FreespaceChecker(PathQuery* intro) : intro{intro} {}
|
||||
|
||||
enum Status {
|
||||
ST_OK,
|
||||
@@ -40,7 +44,7 @@ Q_SIGNALS:
|
||||
void reply(int status, const QString &message, quint64 available);
|
||||
|
||||
private:
|
||||
Intro *intro;
|
||||
PathQuery* intro;
|
||||
};
|
||||
|
||||
#endif // BITCOIN_QT_FREESPACECHECKER_H
|
||||
|
@@ -5,14 +5,14 @@
|
||||
#ifndef BITCOIN_QT_INTRO_H
|
||||
#define BITCOIN_QT_INTRO_H
|
||||
|
||||
#include <qt/freespacechecker.h>
|
||||
|
||||
#include <QDialog>
|
||||
#include <QMutex>
|
||||
#include <QThread>
|
||||
|
||||
static const bool DEFAULT_CHOOSE_DATADIR = false;
|
||||
|
||||
class FreespaceChecker;
|
||||
|
||||
namespace interfaces {
|
||||
class Node;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ namespace Ui {
|
||||
Allows the user to choose a data directory,
|
||||
in which the wallet and block chain will be stored.
|
||||
*/
|
||||
class Intro : public QDialog
|
||||
class Intro : public QDialog, public FreespaceChecker::PathQuery
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -78,7 +78,7 @@ private:
|
||||
|
||||
void startThread();
|
||||
void checkPath(const QString &dataDir);
|
||||
QString getPathToCheck();
|
||||
QString getPathToCheck() override;
|
||||
void UpdatePruneLabels(bool prune_checked);
|
||||
void UpdateFreeSpaceLabel();
|
||||
|
||||
|
@@ -16,7 +16,6 @@ EXPECTED_CIRCULAR_DEPENDENCIES = (
|
||||
"node/blockstorage -> validation -> node/blockstorage",
|
||||
"node/utxo_snapshot -> validation -> node/utxo_snapshot",
|
||||
"qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel",
|
||||
"qt/freespacechecker -> qt/intro -> qt/freespacechecker",
|
||||
"qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel",
|
||||
"qt/sendcoinsdialog -> qt/walletmodel -> qt/sendcoinsdialog",
|
||||
"qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel",
|
||||
|
Reference in New Issue
Block a user