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 }


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...
ServerListHandlerhandler ()
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



class ServerListHandler
class ServerListProxyModel

Detailed Description

Definition at line 33 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 51 of file serverlistmodel.h.

Member Function Documentation

int ServerListModel::addServer ( ServerPtr  server,
int  response 
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.

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

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.

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