Bitcoin Core
29.99.0
P2P Digital Currency
src
qt
freespacechecker.h
Go to the documentation of this file.
1
// Copyright (c) 2011-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_QT_FREESPACECHECKER_H
6
#define BITCOIN_QT_FREESPACECHECKER_H
7
8
#include <QObject>
9
#include <QString>
10
#include <QtGlobal>
11
12
/* Check free space asynchronously to prevent hanging the UI thread.
13
14
Up to one request to check a path is in flight to this thread; when the check()
15
function runs, the current path is requested from the associated Intro object.
16
The reply is sent back through a signal.
17
18
This ensures that no queue of checking requests is built up while the user is
19
still entering the path, and that always the most recently entered path is checked as
20
soon as the thread becomes available.
21
*/
22
class
FreespaceChecker
:
public
QObject
23
{
24
Q_OBJECT
25
26
public
:
27
class
PathQuery
28
{
29
public
:
30
virtual
QString
getPathToCheck
() = 0;
31
};
32
33
explicit
FreespaceChecker
(
PathQuery
*
intro
) :
intro
{
intro
} {}
34
35
enum
Status
{
36
ST_OK
,
37
ST_ERROR
38
};
39
40
public
Q_SLOTS:
41
void
check
();
42
43
Q_SIGNALS:
44
void
reply
(
int
status,
const
QString &message, quint64 available);
45
46
private
:
47
PathQuery
*
intro
;
48
};
49
50
#endif
// BITCOIN_QT_FREESPACECHECKER_H
FreespaceChecker::PathQuery
Definition:
freespacechecker.h:28
FreespaceChecker::PathQuery::getPathToCheck
virtual QString getPathToCheck()=0
FreespaceChecker
Definition:
freespacechecker.h:23
FreespaceChecker::FreespaceChecker
FreespaceChecker(PathQuery *intro)
Definition:
freespacechecker.h:33
FreespaceChecker::intro
PathQuery * intro
Definition:
freespacechecker.h:47
FreespaceChecker::Status
Status
Definition:
freespacechecker.h:35
FreespaceChecker::ST_ERROR
@ ST_ERROR
Definition:
freespacechecker.h:37
FreespaceChecker::ST_OK
@ ST_OK
Definition:
freespacechecker.h:36
FreespaceChecker::reply
void reply(int status, const QString &message, quint64 available)
FreespaceChecker::check
void check()
Definition:
freespacechecker.cpp:15
Generated on Thu Sep 4 2025 20:00:31 for Bitcoin Core by
1.9.4