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, SLDT_SERVER_GROUP = Qt::UserRole + 3 } |
Signals | |
void | allRowsContentChanged () |
void | rowContentChanged (int row) |
Public Member Functions | |
ServerListModel (ServerList *parent) | |
int | addServer (ServerPtr server) |
QList< ServerPtr > | customServers () const |
ServerPtr | findSameServer (const Server *server) |
int | findServerOnTheList (const Server *server) |
Finds index of the row where server is contained. | |
ServerList * | handler () |
QList< ServerPtr > | nonSpecialServers () const |
void | redraw (int row) |
void | redraw (Server *server) |
void | redrawAll () |
void | removeServer (const ServerPtr &server) |
ServerPtr | serverFromList (int rowIndex) const |
ServerPtr | serverFromList (const QModelIndex &) const |
QList< ServerPtr > | servers () const |
QList< ServerPtr > | serversForPlugin (const EnginePlugin *plugin) const |
void | setRefreshing (ServerPtr server) |
void | updateFlag (int row, bool force=true) |
int | updateServer (int row, ServerPtr server) |
Friends | |
class | ServerList |
class | ServerListProxyModel |
Definition at line 34 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 52 of file serverlistmodel.h.
int ServerListModel::addServer | ( | ServerPtr | server | ) |
Definition at line 47 of file serverlistmodel.cpp.
ServerPtr ServerListModel::findSameServer | ( | const Server * | server | ) |
Finds "the same" server (plugin, host, port) that isn't necessarilly the same object.
Definition at line 63 of file serverlistmodel.cpp.
int ServerListModel::findServerOnTheList | ( | const Server * | server | ) |
Finds index of the row where server is contained.
Definition at line 76 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 90 of file serverlistmodel.cpp.
void ServerListModel::redraw | ( | Server * | server | ) |
Redraws row for the specified server. Does nothing if server is not found in the model.
Definition at line 97 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 208 of file serverlistmodel.cpp.
int ServerListModel::updateServer | ( | int | row, |
ServerPtr | server | ||
) |
Returns row index.
Definition at line 194 of file serverlistmodel.cpp.