summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-28 03:23:22 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-01-16 07:48:18 +0100
commitd180f35894dff9fa470235e55b2155d5326569ba (patch)
treedc9c23f8f8a7316dde1a82d8dd9e58518c2785af
parenta80b8da2d303c666f97460347a36e454bff83c5b (diff)
tracker/s2bot: don't change a setting at random
The settings need a proper save/load mechanism to operate.
-rw-r--r--tracker-s2bot/ftnoir_tracker_s2bot.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tracker-s2bot/ftnoir_tracker_s2bot.cpp b/tracker-s2bot/ftnoir_tracker_s2bot.cpp
index 0b8976fc..c1cb7d9b 100644
--- a/tracker-s2bot/ftnoir_tracker_s2bot.cpp
+++ b/tracker-s2bot/ftnoir_tracker_s2bot.cpp
@@ -28,8 +28,10 @@ static constexpr int add_cbx[] =
};
void tracker_s2bot::run() {
- if (s.freq == 0) s.freq = 10;
- timer.setInterval(1000.0/s.freq);
+ int freq = s.freq;
+ if (freq <= 0)
+ freq = 10;
+ timer.setInterval((int)(1000./freq));
timer.setSingleShot(false);
connect(&timer, &QTimer::timeout, [this] {
auto reply = m_nam->get(QNetworkRequest(QUrl("http://localhost:17317/poll")));