SailorgramContactsModel::SailorgramContactsModel(QObject *parent) : QIdentityProxyModel(parent)
{
    this->_telegramcontactsmodel = new TelegramContactsModel(this);
    this->setSourceModel(this->_telegramcontactsmodel);

    connect(this->_telegramcontactsmodel, SIGNAL(telegramChanged()), this, SIGNAL(telegramChanged()));
    connect(this->_telegramcontactsmodel, SIGNAL(countChanged()), this, SIGNAL(countChanged()));
    connect(this->_telegramcontactsmodel, SIGNAL(initializingChanged()), this, SIGNAL(initializingChanged()));
}
Esempio n. 2
0
void TelegramContactsModel::setTelegram(TelegramQml *tgo)
{
    TelegramQml *tg = static_cast<TelegramQml*>(tgo);
    if( p->telegram == tg )
        return;

    p->telegram = tg;
    emit telegramChanged();
    if( !p->telegram )
        return;

    connect( p->telegram, SIGNAL(contactsChanged()), SLOT(contactsChanged()) );
    refresh();
}
Esempio n. 3
0
void TelegramMessagesModel::setTelegram(TelegramQml *tgo)
{
    TelegramQml *tg = static_cast<TelegramQml*>(tgo);
    if( p->telegram == tg )
        return;

    p->telegram = tg;
    p->initializing = tg;
    emit telegramChanged();
    emit initializingChanged();
    if( !p->telegram )
        return;

    connect( p->telegram, SIGNAL(messagesChanged(bool)), SLOT(messagesChanged(bool)) );

    init();
}