ServerListModel Class Reference
+ Inheritance diagram for ServerListModel:

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 rowContentChanged (int row)
 

Public Member Functions

 ServerListModel (ServerList *parent)
 
int addServer (ServerPtr server)
 
QList< ServerPtr > customServers () const
 
int findServerOnTheList (const Server *server)
 Finds index of the row where server is contained. More...
 
ServerListhandler ()
 
QList< ServerPtr > nonSpecialServers () const
 
void redraw (int row)
 
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
 

Detailed Description

Definition at line 34 of file serverlistmodel.h.

Member Enumeration Documentation

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.

Member Function Documentation

int ServerListModel::addServer ( ServerPtr  server)
Returns
New row index.

Definition at line 46 of file serverlistmodel.cpp.

int ServerListModel::findServerOnTheList ( const Server server)

Finds index of the row where server is contained.

Returns
-1 in case of a failure or index of the row otherwise.

Definition at line 64 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 80 of file serverlistmodel.cpp.

void ServerListModel::updateFlag ( int  row,
bool  force = true 
)

Updates flag on given row.

Parameters
row- index of row to update

Definition at line 204 of file serverlistmodel.cpp.

int ServerListModel::updateServer ( int  row,
ServerPtr  server 
)

Returns row index.

Definition at line 190 of file serverlistmodel.cpp.


The documentation for this class was generated from the following files: