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;
|
||||
|
||||
|
||||
auto const shuffledBootstrapNodes = shuffleBootstrapNodes(bootstrapListGenerator.getBootstrapnodes());
|
||||
auto const shuffledBootstrapNodes = shuffleBootstrapNodes(bootstrapListGenerator.getBootstrapNodes());
|
||||
if (shuffledBootstrapNodes.empty()) {
|
||||
qWarning() << "No bootstrap node list";
|
||||
return;
|
||||
|
|
|
@ -32,5 +32,5 @@ public:
|
|||
IBootstrapListGenerator(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_);
|
||||
}
|
||||
|
||||
QList<DhtServer> BootstrapNodeUpdater::getBootstrapnodes() const
|
||||
QList<DhtServer> BootstrapNodeUpdater::getBootstrapNodes() const
|
||||
{
|
||||
auto userFilePath = paths.getUserNodesFilePath();
|
||||
if (QFile::exists(userFilePath)) {
|
||||
|
|
|
@ -35,7 +35,7 @@ class BootstrapNodeUpdater : public QObject, public IBootstrapListGenerator
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit BootstrapNodeUpdater(const QNetworkProxy& proxy_, Paths& paths_, QObject* parent = nullptr);
|
||||
QList<DhtServer> getBootstrapnodes() const override;
|
||||
QList<DhtServer> getBootstrapNodes() const override;
|
||||
void requestBootstrapNodes();
|
||||
static QList<DhtServer> loadDefaultBootstrapNodes();
|
||||
|
||||
|
|
|
@ -37,10 +37,10 @@ Q_DECLARE_METATYPE(QList<DhtServer>)
|
|||
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user