Skip to content

Commit bb8b80a

Browse files
committed
Adjust code according to changes in the main repository
The following changes considered: - bitcoin/bitcoin#27419 - bitcoin/bitcoin#27491 - bitcoin/bitcoin#27576 - bitcoin/bitcoin#27636
1 parent 35c1d3e commit bb8b80a

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

qml/bitcoin.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <qml/bitcoin.h>
66

77
#include <chainparams.h>
8+
#include <common/args.h>
9+
#include <common/system.h>
810
#include <init.h>
911
#include <interfaces/chain.h>
1012
#include <interfaces/init.h>
@@ -30,7 +32,6 @@
3032
#include <qt/initexecutor.h>
3133
#include <qt/networkstyle.h>
3234
#include <qt/peertablemodel.h>
33-
#include <util/system.h>
3435
#include <util/threadnames.h>
3536
#include <util/translation.h>
3637

@@ -145,7 +146,7 @@ void setupChainQSettings(QGuiApplication* app, QString chain)
145146
int QmlGuiMain(int argc, char* argv[])
146147
{
147148
#ifdef WIN32
148-
util::WinCmdLineArgs winArgs;
149+
common::WinCmdLineArgs winArgs;
149150
std::tie(argc, argv) = winArgs.get();
150151
#endif // WIN32
151152

@@ -192,7 +193,7 @@ int QmlGuiMain(int argc, char* argv[])
192193

193194
/// Check for chain settings (Params() calls are only valid after this clause).
194195
try {
195-
SelectParams(gArgs.GetChainName());
196+
SelectParams(gArgs.GetChainType());
196197
} catch(std::exception &e) {
197198
InitError(Untranslated(strprintf("%s\n", e.what())));
198199
return EXIT_FAILURE;
@@ -248,7 +249,7 @@ int QmlGuiMain(int argc, char* argv[])
248249
#endif
249250

250251
ChainModel chain_model{*chain};
251-
chain_model.setCurrentNetworkName(QString::fromStdString(gArgs.GetChainName()));
252+
chain_model.setCurrentNetworkName(QString::fromStdString(ChainTypeToString(gArgs.GetChainType())));
252253
setupChainQSettings(&app, chain_model.currentNetworkName());
253254

254255
QObject::connect(&node_model, &NodeModel::setTimeRatioList, &chain_model, &ChainModel::setTimeRatioList);
@@ -268,7 +269,7 @@ int QmlGuiMain(int argc, char* argv[])
268269

269270
QQmlApplicationEngine engine;
270271

271-
QScopedPointer<const NetworkStyle> network_style{NetworkStyle::instantiate(Params().NetworkIDString())};
272+
QScopedPointer<const NetworkStyle> network_style{NetworkStyle::instantiate(Params().GetChainType())};
272273
assert(!network_style.isNull());
273274
engine.addImageProvider(QStringLiteral("images"), new ImageProvider{network_style.data()});
274275

qml/models/options_model.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
#include <qml/models/options_model.h>
66

7+
#include <common/args.h>
8+
#include <common/settings.h>
9+
#include <common/system.h>
710
#include <interfaces/node.h>
811
#include <qt/guiconstants.h>
912
#include <qt/optionsmodel.h>
1013
#include <txdb.h>
1114
#include <univalue.h>
12-
#include <util/settings.h>
13-
#include <util/system.h>
1415
#include <validation.h>
1516

1617
#include <cassert>
@@ -99,7 +100,7 @@ void OptionsQmlModel::setUpnp(bool new_upnp)
99100
}
100101
}
101102

102-
util::SettingsValue OptionsQmlModel::pruneSetting() const
103+
common::SettingsValue OptionsQmlModel::pruneSetting() const
103104
{
104105
assert(!m_prune || m_prune_size_gb >= 1);
105106
return m_prune ? PruneGBtoMiB(m_prune_size_gb) : 0;

qml/models/options_model.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#define BITCOIN_QML_MODELS_OPTIONS_MODEL_H
77

88
#include <txdb.h>
9-
#include <util/settings.h>
10-
#include <util/system.h>
9+
#include <common/settings.h>
10+
#include <common/system.h>
1111
#include <validation.h>
1212

1313
#include <QObject>
@@ -84,7 +84,7 @@ class OptionsQmlModel : public QObject
8484
bool m_server;
8585
bool m_upnp;
8686

87-
util::SettingsValue pruneSetting() const;
87+
common::SettingsValue pruneSetting() const;
8888
};
8989

9090
#endif // BITCOIN_QML_MODELS_OPTIONS_MODEL_H

0 commit comments

Comments
 (0)