Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
CoreAccountModel Class Reference

#include </tmp/quassel/src/client/coreaccountmodel.h>

Collaboration diagram for CoreAccountModel:

Public Types

enum  { AccountIdRole = Qt::UserRole, UuidRole }

Public Slots

void save ()
void load ()
void clear ()

Public Member Functions

 CoreAccountModel (QObject *parent=0)
 CoreAccountModel (const CoreAccountModel *other, QObject *parent=0)
int rowCount (const QModelIndex &parent=QModelIndex()) const
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
CoreAccount account (const QModelIndex &) const
CoreAccount account (AccountId) const
QList< CoreAccountaccounts () const
QList< AccountIdaccountIds () const
QModelIndex accountIndex (AccountId id) const
AccountId internalAccount () const
AccountId createOrUpdateAccount (const CoreAccount &newAccountData)
CoreAccount takeAccount (AccountId)
void removeAccount (AccountId)
void update (const CoreAccountModel *other)
bool operator== (const CoreAccountModel &other) const

Protected Member Functions

void insertAccount (const CoreAccount &)
int findAccountIdx (AccountId) const

Private Member Functions

int listIndex (AccountId)

Private Attributes

QList< CoreAccount_accounts
QSet< AccountId_removedAccounts
AccountId _internalAccount

Detailed Description

Definition at line 29 of file coreaccountmodel.h.

Member Enumeration Documentation

anonymous enum

Definition at line 34 of file coreaccountmodel.h.

Constructor & Destructor Documentation

CoreAccountModel ( QObject *  parent = 0)

Definition at line 26 of file coreaccountmodel.cpp.

CoreAccountModel ( const CoreAccountModel other,
QObject *  parent = 0 

Definition at line 33 of file coreaccountmodel.cpp.

References update().

Member Function Documentation

int rowCount ( const QModelIndex &  parent = QModelIndex()) const

Definition at line 80 of file coreaccountmodel.h.

References _accounts.

Referenced by clear(), and data().

QVariant data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
CoreAccount account ( const QModelIndex &  idx) const

Definition at line 129 of file coreaccountmodel.cpp.

References _accounts.

Referenced by CoreConnection::connectToCore(), and CoreAccountSettingsPage::load().

CoreAccount account ( AccountId  id) const

Definition at line 120 of file coreaccountmodel.cpp.

References _accounts, and findAccountIdx().

QList< CoreAccount > accounts ( ) const

Definition at line 137 of file coreaccountmodel.cpp.

References _accounts.

Referenced by accountIds(), createOrUpdateAccount(), data(), and save().

QList< AccountId > accountIds ( ) const

Definition at line 143 of file coreaccountmodel.cpp.

References CoreAccount::accountId(), and accounts().

Referenced by createOrUpdateAccount().

QModelIndex accountIndex ( AccountId  id) const

Definition at line 243 of file coreaccountmodel.cpp.

References _accounts.

Referenced by findAccountIdx().

CoreAccount takeAccount ( AccountId  accId)
void removeAccount ( AccountId  accId)
bool operator== ( const CoreAccountModel other) const

Definition at line 152 of file coreaccountmodel.cpp.

References _accounts.

void clear ( )

Definition at line 88 of file coreaccountmodel.cpp.

References _accounts, _internalAccount, and rowCount().

Referenced by load(), and update().

int findAccountIdx ( AccountId  id) const

Definition at line 253 of file coreaccountmodel.cpp.

References accountIndex().

Referenced by account(), createOrUpdateAccount(), and takeAccount().

int listIndex ( AccountId  )

Member Data Documentation

QSet<AccountId> _removedAccounts

Definition at line 74 of file coreaccountmodel.h.

Referenced by createOrUpdateAccount(), removeAccount(), save(), and update().

AccountId _internalAccount

Definition at line 75 of file coreaccountmodel.h.

Referenced by clear(), insertAccount(), internalAccount(), load(), takeAccount(), and update().

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