mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 22:45:34 +00:00
[Browser] Stop PingHelper on refresh
This commit is contained in:
parent
647661daf9
commit
5b8f4f3e92
4 changed files with 9 additions and 1 deletions
|
@ -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…
Reference in a new issue