File tree Expand file tree Collapse file tree 4 files changed +12
-15
lines changed Expand file tree Collapse file tree 4 files changed +12
-15
lines changed Original file line number Diff line number Diff line change 5
5
#include < qt/freespacechecker.h>
6
6
7
7
#include < qt/guiutil.h>
8
- #include < qt/intro.h>
9
8
#include < util/fs.h>
10
9
11
10
#include < QDir>
12
11
#include < QString>
13
12
14
13
#include < cstdint>
15
14
16
- FreespaceChecker::FreespaceChecker (Intro *_intro)
17
- {
18
- this ->intro = _intro;
19
- }
20
-
21
15
void FreespaceChecker::check ()
22
16
{
23
17
QString dataDirStr = intro->getPathToCheck ();
Original file line number Diff line number Diff line change 9
9
#include < QString>
10
10
#include < QtGlobal>
11
11
12
- class Intro ;
13
-
14
12
/* Check free space asynchronously to prevent hanging the UI thread.
15
13
16
14
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
26
24
Q_OBJECT
27
25
28
26
public:
29
- explicit FreespaceChecker (Intro *intro);
27
+ class PathQuery
28
+ {
29
+ public:
30
+ virtual QString getPathToCheck () = 0;
31
+ };
32
+
33
+ explicit FreespaceChecker (PathQuery* intro) : intro{intro} {}
30
34
31
35
enum Status {
32
36
ST_OK,
@@ -40,7 +44,7 @@ public Q_SLOTS:
40
44
void reply (int status, const QString &message, quint64 available);
41
45
42
46
private:
43
- Intro * intro;
47
+ PathQuery* intro;
44
48
};
45
49
46
50
#endif // BITCOIN_QT_FREESPACECHECKER_H
Original file line number Diff line number Diff line change 5
5
#ifndef BITCOIN_QT_INTRO_H
6
6
#define BITCOIN_QT_INTRO_H
7
7
8
+ #include < qt/freespacechecker.h>
9
+
8
10
#include < QDialog>
9
11
#include < QMutex>
10
12
#include < QThread>
11
13
12
14
static const bool DEFAULT_CHOOSE_DATADIR = false ;
13
15
14
- class FreespaceChecker ;
15
-
16
16
namespace interfaces {
17
17
class Node ;
18
18
}
@@ -25,7 +25,7 @@ namespace Ui {
25
25
Allows the user to choose a data directory,
26
26
in which the wallet and block chain will be stored.
27
27
*/
28
- class Intro : public QDialog
28
+ class Intro : public QDialog , public FreespaceChecker ::PathQuery
29
29
{
30
30
Q_OBJECT
31
31
@@ -78,7 +78,7 @@ private Q_SLOTS:
78
78
79
79
void startThread ();
80
80
void checkPath (const QString &dataDir);
81
- QString getPathToCheck ();
81
+ QString getPathToCheck () override ;
82
82
void UpdatePruneLabels (bool prune_checked);
83
83
void UpdateFreeSpaceLabel ();
84
84
Original file line number Diff line number Diff line change 16
16
"node/blockstorage -> validation -> node/blockstorage" ,
17
17
"node/utxo_snapshot -> validation -> node/utxo_snapshot" ,
18
18
"qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel" ,
19
- "qt/freespacechecker -> qt/intro -> qt/freespacechecker" ,
20
19
"qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel" ,
21
20
"qt/sendcoinsdialog -> qt/walletmodel -> qt/sendcoinsdialog" ,
22
21
"qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel" ,
You can’t perform that action at this time.
0 commit comments