Public Types | |
enum | ServerGroup { SG_NORMAL = 200, SG_WAIT = 175, SG_BANNED = 150, SG_TIMEOUT = 125, SG_BAD = 100, SG_FIRST_QUERY = 50 } |
enum | ServerListDataTypes { SLDT_POINTER_TO_SERVER_STRUCTURE = Qt::UserRole+1, SLDT_SORT = Qt::UserRole+2 } |
Signals | |
void | allRowsContentChanged () |
void | modelCleared () |
void | rowContentChanged (int row) |
Public Member Functions | |
ServerListModel (ServerListHandler *parent) | |
int | addServer (ServerPtr server, int response) |
void | destroyRows () |
int | findServerOnTheList (const Server *server) |
Finds index of the row where server is contained. More... | |
ServerListHandler * | handler () |
void | redraw (int row) |
void | redrawAll () |
void | removeCustomServers () |
ServerPtr | serverFromList (int rowIndex) |
ServerPtr | serverFromList (const QModelIndex &) |
void | setRefreshing (ServerPtr server) |
void | updateFlag (int row, bool force=true) |
int | updateServer (int row, ServerPtr server, int response) |
Protected Member Functions | |
QVariant | columnSortData (int row, int column) |
void | prepareHeaders () |
ServerGroup | serverGroup (int row) |
Protected Attributes | |
ServerListHandler * | parentHandler |
Friends | |
class | ServerListHandler |
class | ServerListProxyModel |
Definition at line 33 of file serverlistmodel.h.
Servers from the same group will be always kept together and sorted only inside this group. Group order is always descending: SG_NORMAL servers will be always on the top of the list, after them will be SG_WAIT servers, etc.
WARNING: Exception: custom servers will always be on top of the list and will be sorted inside their own group independentedly.
Definition at line 51 of file serverlistmodel.h.
int ServerListModel::addServer | ( | ServerPtr | server, |
int | response | ||
) |
Definition at line 46 of file serverlistmodel.cpp.
int ServerListModel::findServerOnTheList | ( | const Server * | server | ) |
Finds index of the row where server is contained.
Definition at line 73 of file serverlistmodel.cpp.
void ServerListModel::redraw | ( | int | row | ) |
Enforces update of a given row. No modificiation is done to the server info itself. Can be used to redraw things like background.
Definition at line 89 of file serverlistmodel.cpp.
void ServerListModel::updateFlag | ( | int | row, |
bool | force = true |
||
) |
Updates flag on given row.
row | - index of row to update |
Definition at line 176 of file serverlistmodel.cpp.
int ServerListModel::updateServer | ( | int | row, |
ServerPtr | server, | ||
int | response | ||
) |
Returns row index.
Definition at line 162 of file serverlistmodel.cpp.