From 22375e3b8f51c5117cb4c8b06b7da8114d513705 Mon Sep 17 00:00:00 2001 From: Bill Winslow Date: Sun, 27 Jul 2014 15:55:22 -0500 Subject: [PATCH] Randomized the bootstrap table, to distribute load away from the first 5 --- core.cpp | 6 ++++-- widget/form/settingsform.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core.cpp b/core.cpp index d49c95266..94afee0ee 100644 --- a/core.cpp +++ b/core.cpp @@ -108,6 +108,8 @@ void Core::start() return; } + qsrand(time(nullptr)); + loadConfiguration(); tox_callback_friend_request(tox, onFriendRequest, this); @@ -675,9 +677,9 @@ void Core::bootstrapDht() const Settings& s = Settings::getInstance(); QList dhtServerList = s.getDhtServerList(); - static int j = 0; - int i=0; int listSize = dhtServerList.size(); + static int j = qrand() % listSize; + int i=0; while (i<5) { const Settings::DhtServer& dhtServer = dhtServerList[j % listSize]; diff --git a/widget/form/settingsform.cpp b/widget/form/settingsform.cpp index 1179497c5..16eaedb70 100644 --- a/widget/form/settingsform.cpp +++ b/widget/form/settingsform.cpp @@ -48,6 +48,7 @@ SettingsForm::SettingsForm() useTranslations.setChecked(Settings::getInstance().getUseTranslations()); makeToxPortable.setText(tr("Make Tox portable","Text on a checkbox to make qTox a portable application")); makeToxPortable.setChecked(Settings::getInstance().getMakeToxPortable()); + makeToxPortable.setToolTip(tr("Save settings to the working directory instead of the usual conf dir","describes makeToxPortable checkbox")); main->setLayout(&layout); layout.addWidget(&nameLabel);