forked from mirror/openmw-tes3mp
[Browser] Do not show "Unreachable" servers when ping filter is enabled
This commit is contained in:
parent
01a5196a92
commit
ed75563a94
1 changed files with 3 additions and 2 deletions
|
@ -15,11 +15,12 @@ bool MySortFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &
|
||||||
QModelIndex plIndex = sourceModel()->index(sourceRow, ServerData::PLAYERS, sourceParent);
|
QModelIndex plIndex = sourceModel()->index(sourceRow, ServerData::PLAYERS, sourceParent);
|
||||||
QModelIndex maxPlIndex = sourceModel()->index(sourceRow, ServerData::MAX_PLAYERS, sourceParent);
|
QModelIndex maxPlIndex = sourceModel()->index(sourceRow, ServerData::MAX_PLAYERS, sourceParent);
|
||||||
|
|
||||||
int ping = sourceModel()->data(pingIndex).toInt();
|
bool pingOk;
|
||||||
|
int ping = sourceModel()->data(pingIndex).toInt(&pingOk);
|
||||||
int players = sourceModel()->data(plIndex).toInt();
|
int players = sourceModel()->data(plIndex).toInt();
|
||||||
int maxPlayers = sourceModel()->data(maxPlIndex).toInt();
|
int maxPlayers = sourceModel()->data(maxPlIndex).toInt();
|
||||||
|
|
||||||
if (maxPing > 0 && (ping == -1 || ping > maxPing))
|
if (maxPing > 0 && (ping == -1 || ping > maxPing || !pingOk))
|
||||||
return false;
|
return false;
|
||||||
if (filterEmpty && players == 0)
|
if (filterEmpty && players == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue