コード例 #1
0
ファイル: status-actions.cpp プロジェクト: partition/kadu
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());
}
コード例 #2
0
ファイル: status.cpp プロジェクト: partition/kadu
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();
}