[Browser] Stop PingHelper on refresh

pull/367/head
Koncord 7 years ago
parent 647661daf9
commit 5b8f4f3e92

@ -14,6 +14,12 @@ void PingHelper::Add(int row, const AddrPair &addrPair)
pingThread->start();
}
void PingHelper::Reset()
{
//if (pingThread->isRunning())
Stop();
}
void PingHelper::Stop()
{
emit pingUpdater->stop();

@ -17,6 +17,7 @@ class PingHelper : public QObject
Q_OBJECT
public:
void Reset();
void Add(int row, const AddrPair &addrPair);
void Stop();
void SetModel(QAbstractTableModel *model);

@ -42,7 +42,7 @@ void PingUpdater::process()
unsigned ping = PingRakNetServer(server.second.first.toLatin1(), server.second.second);
qDebug() << "Pong from" << server.second.first + "|" + QString::number(server.second.second)
<< ":" << ping << "ms";
<< ":" << ping << "ms" << "Sizeof servers: " << servers.size();
emit updateModel(server.first, ping);
}

@ -29,6 +29,7 @@ void QueryHelper::refresh()
if (!queryThread->isRunning())
{
_model->removeRows(0, _model->rowCount());
PingHelper::Get().Stop();
queryThread->start();
emit started();
}

Loading…
Cancel
Save