1
0
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:
Anthony Bilinski 2022-03-12 23:45:17 -08:00
parent faa72d567e
commit 7395c1cb3f
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
5 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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;
}; };

View File

@ -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)) {

View File

@ -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();

View File

@ -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();
} }