-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathdatadir.h
More file actions
60 lines (46 loc) · 1.55 KB
/
Copy pathdatadir.h
File metadata and controls
60 lines (46 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright (c) 2026 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QML_DATADIR_H
#define BITCOIN_QML_DATADIR_H
#include <util/fs.h>
#include <QString>
#include <cstdint>
class ArgsManager;
namespace QmlDataDir {
enum class GuiDataDirSource {
Default,
Settings,
LegacySettings,
};
struct GuiDataDir {
QString path;
GuiDataDirSource source{GuiDataDirSource::Default};
};
struct StorageSpaceResult {
QString path;
QString checked_path;
QString message;
uint64_t available_bytes{0};
uint64_t capacity_bytes{0};
bool ok{false};
bool path_exists{false};
bool path_is_directory{false};
};
QString DefaultDataDirString();
QString NormalizeLocalPath(QString path);
fs::path QStringToPath(const QString& path);
GuiDataDir ReadGuiDataDirWithSource();
QString ReadGuiDataDir();
bool IsDefaultDataDir(const QString& path);
QString ValidateCustomDataDir(const QString& path);
StorageSpaceResult CheckStorageSpace(const QString& path);
bool EnsureDataDir(const QString& path, QString* error = nullptr);
bool PersistGuiDataDirSelection(const QString& path, QString* error = nullptr);
void PersistDefaultDataDirSelection();
bool HasExplicitDataDirArg(const ArgsManager& args);
bool ShouldShowDataDirChooser(const ArgsManager& args);
bool ApplyGuiDataDirSetting(ArgsManager& args);
bool ApplyDataDirArg(ArgsManager& args, const QString& path);
} // namespace QmlDataDir
#endif // BITCOIN_QML_DATADIR_H