Example #1
0
File: tabs.cpp Project: vogel/kadu
void TabsManager::load()
{
    if (!isValidStorage())
        return;

    StorableObject::load();

    QDomElement itemsNode = storage()->point();
    if (itemsNode.isNull())
        return;

    QVector<QDomElement> itemElements = storage()->storage()->getNodes(itemsNode, "Tab");
    foreach (const QDomElement &element, itemElements)
    {
        QUuid chatId(element.attribute("chat"));

        if (chatId.isNull())
            continue;

        Chat chat = m_chatManager->byUuid(chatId);
        if (!chat)
            continue;

        if (element.attribute("type") == "detachedChat")
            chat.addProperty("tabs:detached", true, CustomProperties::Storable);
        else if (element.attribute("type") == "tab")
            chat.addProperty("tabs:attached", true, CustomProperties::Storable);

        m_chatWidgetManager->openChat(chat, OpenChatActivation::DoNotActivate);
    }
Example #2
0
void RecentChatService::add(Chat chat) const
{
    chat.addProperty(LAST_MESSAGE_DATE_TIME_PROPERTY, QDateTime::currentDateTimeUtc(), CustomProperties::Storable);
    update(chat);
}