void StatusActions::createActions() { createBasicActions(); createStatusActions(); QList<StatusType *> statusTypes = MyStatusContainer->supportedStatusTypes(); if (statusTypes.isEmpty()) return; StatusType *statusType = statusTypes.at(0); if (0 == statusType) return; StatusGroup *currentGroup = statusType->statusGroup(); bool setDescriptionAdded = false; foreach (StatusType *statusType, statusTypes) { if (0 == statusType) continue; if (!setDescriptionAdded && statusType->statusGroup() && statusType->statusGroup()->sortIndex() >= StatusGroup::StatusGroupSortIndexAfterSetDescription) { Actions.append(createSeparator()); Actions.append(ChangeDescription); } if (statusType->statusGroup() != currentGroup) { Actions.append(createSeparator()); currentGroup = statusType->statusGroup(); } Actions.append(StatusTypeActions[statusType]); } Actions.append(createSeparator()); }
void Status::setType(const QString& type) { Group = "Offline"; DisplayName = "Offline"; Type = type; StatusType *statusType = StatusTypeManager::instance()->statusType(Type); if (!statusType) { Type = "Offline"; return; } else DisplayName = statusType->displayName(); StatusGroup *statusGroup = statusType->statusGroup(); if (statusGroup) Group = statusGroup->name(); }