|
|
@ -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;
|
|
|
|