This class is used by AccountViewModel to hold a list of the accounts. More...
#include <accountviewitem.h>
Public Member Functions | |
AccountViewItem (bool active, const QString &name, const QString &server, const QString &user, int numberMails, long totalSize, QPointer< Account > account) | |
Contructor. | |
bool | isActive () const |
Returns whether the account is active. | |
QString | getName () const |
Returns the account name. | |
QString | getServer () const |
Returns ther server host name. | |
QString | getUser () const |
Returns the user. | |
int | getNumberMails () const |
Returns the number of mails. | |
QString | getTotalSizeUnit () const |
Returns the total size of mails with appended unit. | |
long | getTotalSize () const |
Returns the total size of mails. | |
QPointer< Account > | getAccount () const |
Returns the pointer to the account. | |
int | compare (const AccountViewItem &other, AccountSort_Type property) |
Compares this account with other and returns an integer less than, equal to, or greater than zero if this account is less than, equal to, or greater than other. | |
Private Attributes | |
bool | active |
true - the account is active | |
QString | name |
account name | |
QString | server |
server | |
QString | user |
user | |
int | numberMails |
number of mails | |
long | totalSize |
total size of mails, inclusive unit | |
QPointer< Account > | account |
pointer to the account |
This class is used by AccountViewModel to hold a list of the accounts.
It can't use a list of pointers to a account because this pointers can be invalid for a short time after an account was removed. When the account view refreshes in this time the app crashed.
Definition at line 37 of file accountviewitem.h.
AccountViewItem::AccountViewItem | ( | bool | active, | |
const QString & | name, | |||
const QString & | server, | |||
const QString & | user, | |||
int | numberMails, | |||
long | totalSize, | |||
QPointer< Account > | account | |||
) |
Contructor.
active | true - the account is active; false - the account is not active
|
Definition at line 20 of file accountviewitem.cpp.
int AccountViewItem::compare | ( | const AccountViewItem & | other, | |
AccountSort_Type | property | |||
) |
Compares this account with other and returns an integer less than, equal to, or greater than zero if this account is less than, equal to, or greater than other.
other | other account
|
Definition at line 77 of file accountviewitem.cpp.
QPointer< Account > AccountViewItem::getAccount | ( | ) | const |
Returns the pointer to the account.
Definition at line 40 of file accountviewitem.cpp.
QString AccountViewItem::getName | ( | ) | const |
int AccountViewItem::getNumberMails | ( | ) | const |
Returns the number of mails.
Definition at line 45 of file accountviewitem.cpp.
QString AccountViewItem::getServer | ( | ) | const |
Returns ther server host name.
Definition at line 35 of file accountviewitem.cpp.
long int AccountViewItem::getTotalSize | ( | ) | const |
Returns the total size of mails.
Definition at line 132 of file accountviewitem.cpp.
QString AccountViewItem::getTotalSizeUnit | ( | ) | const |
Returns the total size of mails with appended unit.
Definition at line 50 of file accountviewitem.cpp.
QString AccountViewItem::getUser | ( | ) | const |
bool AccountViewItem::isActive | ( | ) | const |
Returns whether the account is active.
true
- account is active; false
- account isn't active Definition at line 25 of file accountviewitem.cpp.
QPointer<Account> AccountViewItem::account [private] |
pointer to the account
Definition at line 147 of file accountviewitem.h.
bool AccountViewItem::active [private] |
true
- the account is active
Definition at line 117 of file accountviewitem.h.
QString AccountViewItem::name [private] |
account name
Definition at line 122 of file accountviewitem.h.
int AccountViewItem::numberMails [private] |
number of mails
Definition at line 137 of file accountviewitem.h.
QString AccountViewItem::server [private] |
server
Definition at line 127 of file accountviewitem.h.
long AccountViewItem::totalSize [private] |
total size of mails, inclusive unit
Definition at line 142 of file accountviewitem.h.
QString AccountViewItem::user [private] |
user
Definition at line 132 of file accountviewitem.h.