mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor(model): Fix case of IBootstrapListGenerator::getBootstrapNodes
This commit is contained in:
parent
faa72d567e
commit
7395c1cb3f
|
@ -830,7 +830,7 @@ void Core::bootstrapDht()
|
||||||
ASSERT_CORE_THREAD;
|
ASSERT_CORE_THREAD;
|
||||||
|
|
||||||
|
|
||||||
auto const shuffledBootstrapNodes = shuffleBootstrapNodes(bootstrapListGenerator.getBootstrapnodes());
|
auto const shuffledBootstrapNodes = shuffleBootstrapNodes(bootstrapListGenerator.getBootstrapNodes());
|
||||||
if (shuffledBootstrapNodes.empty()) {
|
if (shuffledBootstrapNodes.empty()) {
|
||||||
qWarning() << "No bootstrap node list";
|
qWarning() << "No bootstrap node list";
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -32,5 +32,5 @@ public:
|
||||||
IBootstrapListGenerator(IBootstrapListGenerator&&) = default;
|
IBootstrapListGenerator(IBootstrapListGenerator&&) = default;
|
||||||
IBootstrapListGenerator& operator=(IBootstrapListGenerator&&) = default;
|
IBootstrapListGenerator& operator=(IBootstrapListGenerator&&) = default;
|
||||||
|
|
||||||
virtual QList<DhtServer> getBootstrapnodes() const = 0;
|
virtual QList<DhtServer> getBootstrapNodes() const = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -228,7 +228,7 @@ BootstrapNodeUpdater::BootstrapNodeUpdater(const QNetworkProxy& proxy_, Paths& p
|
||||||
createExampleBootstrapNodesFile(paths_);
|
createExampleBootstrapNodesFile(paths_);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<DhtServer> BootstrapNodeUpdater::getBootstrapnodes() const
|
QList<DhtServer> BootstrapNodeUpdater::getBootstrapNodes() const
|
||||||
{
|
{
|
||||||
auto userFilePath = paths.getUserNodesFilePath();
|
auto userFilePath = paths.getUserNodesFilePath();
|
||||||
if (QFile::exists(userFilePath)) {
|
if (QFile::exists(userFilePath)) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ class BootstrapNodeUpdater : public QObject, public IBootstrapListGenerator
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit BootstrapNodeUpdater(const QNetworkProxy& proxy_, Paths& paths_, QObject* parent = nullptr);
|
explicit BootstrapNodeUpdater(const QNetworkProxy& proxy_, Paths& paths_, QObject* parent = nullptr);
|
||||||
QList<DhtServer> getBootstrapnodes() const override;
|
QList<DhtServer> getBootstrapNodes() const override;
|
||||||
void requestBootstrapNodes();
|
void requestBootstrapNodes();
|
||||||
static QList<DhtServer> loadDefaultBootstrapNodes();
|
static QList<DhtServer> loadDefaultBootstrapNodes();
|
||||||
|
|
||||||
|
|
|
@ -37,10 +37,10 @@ Q_DECLARE_METATYPE(QList<DhtServer>)
|
||||||
|
|
||||||
class MockNodeListGenerator : public IBootstrapListGenerator
|
class MockNodeListGenerator : public IBootstrapListGenerator
|
||||||
{
|
{
|
||||||
QList<DhtServer> getBootstrapnodes() const override;
|
QList<DhtServer> getBootstrapNodes() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
QList<DhtServer> MockNodeListGenerator::getBootstrapnodes() const {
|
QList<DhtServer> MockNodeListGenerator::getBootstrapNodes() const {
|
||||||
return BootstrapNodeUpdater::loadDefaultBootstrapNodes();
|
return BootstrapNodeUpdater::loadDefaultBootstrapNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user