forked from blue/squawk
Disabled context menu on items of not connected account, roster contacts group moving, bugfixes with roster contacts group moving ungrouping and copying
This commit is contained in:
parent
e4d1e21ea0
commit
415d56ba69
20 changed files with 314 additions and 36 deletions
|
@ -34,6 +34,15 @@ Models::Item::Item(Type p_type, const QMap<QString, QVariant> &p_data, Item *p_p
|
|||
}
|
||||
}
|
||||
|
||||
Models::Item::Item(const Models::Item& other):
|
||||
QObject(),
|
||||
type(other.type),
|
||||
name(other.name),
|
||||
childItems(),
|
||||
parent(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
Models::Item::~Item()
|
||||
{
|
||||
std::deque<Item*>::const_iterator itr = childItems.begin();
|
||||
|
@ -225,6 +234,24 @@ QString Models::Item::getAccountName() const
|
|||
return acc->getName();
|
||||
}
|
||||
|
||||
Shared::Availability Models::Item::getAccountAvailability() const
|
||||
{
|
||||
const Account* acc = static_cast<const Account*>(getParentAccount());
|
||||
if (acc == 0) {
|
||||
return Shared::offline;
|
||||
}
|
||||
return acc->getAvailability();
|
||||
}
|
||||
|
||||
Shared::ConnectionState Models::Item::getAccountConnectionState() const
|
||||
{
|
||||
const Account* acc = static_cast<const Account*>(getParentAccount());
|
||||
if (acc == 0) {
|
||||
return Shared::disconnected;
|
||||
}
|
||||
return acc->getState();
|
||||
}
|
||||
|
||||
QString Models::Item::getDisplayedName() const
|
||||
{
|
||||
return name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue