mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +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();
|
pingThread->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PingHelper::Reset()
|
||||||
|
{
|
||||||
|
//if (pingThread->isRunning())
|
||||||
|
Stop();
|
||||||
|
}
|
||||||
|
|
||||||
void PingHelper::Stop()
|
void PingHelper::Stop()
|
||||||
{
|
{
|
||||||
emit pingUpdater->stop();
|
emit pingUpdater->stop();
|
||||||
|
|
|
@ -17,6 +17,7 @@ class PingHelper : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
void Reset();
|
||||||
void Add(int row, const AddrPair &addrPair);
|
void Add(int row, const AddrPair &addrPair);
|
||||||
void Stop();
|
void Stop();
|
||||||
void SetModel(QAbstractTableModel *model);
|
void SetModel(QAbstractTableModel *model);
|
||||||
|
|
|
@ -42,7 +42,7 @@ void PingUpdater::process()
|
||||||
unsigned ping = PingRakNetServer(server.second.first.toLatin1(), server.second.second);
|
unsigned ping = PingRakNetServer(server.second.first.toLatin1(), server.second.second);
|
||||||
|
|
||||||
qDebug() << "Pong from" << server.second.first + "|" + QString::number(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);
|
emit updateModel(server.first, ping);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ void QueryHelper::refresh()
|
||||||
if (!queryThread->isRunning())
|
if (!queryThread->isRunning())
|
||||||
{
|
{
|
||||||
_model->removeRows(0, _model->rowCount());
|
_model->removeRows(0, _model->rowCount());
|
||||||
|
PingHelper::Get().Stop();
|
||||||
queryThread->start();
|
queryThread->start();
|
||||||
emit started();
|
emit started();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue