Exemplo n.º 1
0
static QString getStatusIconPath(BuddyOrContact buddyOrContact)
{
	Buddy buddy = buddyOrContact.buddy();
	Contact contact = buddyOrContact.contact();

	if (buddy.isBlocked())
		return webKitPath(IconsManager::instance()->iconPath("kadu_icons", "16x16", "blocked"));

	if (contact.isBlocking())
		return webKitPath(IconsManager::instance()->iconPath("kadu_icons", "16x16", "blocking"));

	if (contact.contactAccount())
	{
		Protocol *protocol = contact.contactAccount().protocolHandler();
		if (protocol)
		{
			StatusTypeManager* statustypemanager = StatusTypeManager::instance();
			if (statustypemanager)
			{
				Status status = contact.currentStatus();
				QString iconpath = statustypemanager->statusIconFullPath(protocol->statusPixmapPath(), status.type(), !status.description().isEmpty(), false);
				if (!iconpath.isEmpty())
					return webKitPath(iconpath);
			}
		}
	}

	return QString();
}
Exemplo n.º 2
0
TlenProtocolFactory::TlenProtocolFactory()
{
	StatusTypeManager *statusTypeManager = StatusTypeManager::instance();
	SupportedStatusTypes.append(statusTypeManager->statusType("Online"));
	SupportedStatusTypes.append(statusTypeManager->statusType("FreeForChat"));
	SupportedStatusTypes.append(statusTypeManager->statusType("DoNotDisturb"));
	SupportedStatusTypes.append(statusTypeManager->statusType("Away"));
	SupportedStatusTypes.append(statusTypeManager->statusType("NotAvailable"));
	SupportedStatusTypes.append(statusTypeManager->statusType("Invisible"));
	SupportedStatusTypes.append(statusTypeManager->statusType("Offline"));

	qSort(SupportedStatusTypes.begin(), SupportedStatusTypes.end(), StatusType::lessThan);
}
Exemplo n.º 3
0
TlenProtocolFactory::TlenProtocolFactory()
{
	StatusTypeManager *statusTypeManager = StatusTypeManager::instance();
	SupportedStatusTypes.append(statusTypeManager->statusType("Online"));
	SupportedStatusTypes.append(statusTypeManager->statusType("FreeForChat"));
	SupportedStatusTypes.append(statusTypeManager->statusType("DoNotDisturb"));
	SupportedStatusTypes.append(statusTypeManager->statusType("Away"));
	SupportedStatusTypes.append(statusTypeManager->statusType("NotAvailable"));
	SupportedStatusTypes.append(statusTypeManager->statusType("Invisible"));
	SupportedStatusTypes.append(statusTypeManager->statusType("Offline"));

	qSort(SupportedStatusTypes.begin(), SupportedStatusTypes.end(), StatusType::lessThan);
//TODO 0.6.6:
	IdRegularExpression.setPattern("[a-zA-Z0-9\\._-]+@[a-zA-Z0-9\\._-]+");
}