QGalleryAbstractResponse *QDocumentGalleryPrivate::createItemListResponse(
        QGalleryTrackerResultSetArguments *arguments,
        int offset,
        int limit,
        bool isItemType,
        bool autoUpdate)
{
    QGalleryTrackerResultSet *response = 0;

    if (isItemType) {
        response = new QGalleryTrackerEditableResultSet(
                arguments, metaDataInterface(), autoUpdate, offset, limit);
    } else {
        response = new QGalleryTrackerResultSet(arguments, autoUpdate, offset, limit);
    }

    if (autoUpdate) {
        QObject::connect(
                changeNotifier(), SIGNAL(itemsChanged(int)), response, SLOT(refresh(int)));
    }
    QObject::connect(
            response, SIGNAL(itemEdited(QString)), changeNotifier(), SLOT(itemsEdited(QString)));

    return response;
}
Esempio n. 2
0
void ContactShared::aboutToBeRemoved()
{
    // clean up references
    removeFromBuddy();
    doSetOwnerBuddy(Buddy::null);

    changeNotifier().notify();
}
Esempio n. 3
0
void ContactShared::protocolFactoryRegistered(ProtocolFactory *protocolFactory)
{
    ensureLoaded();

    if (!protocolFactory || !*ContactAccount || ContactAccount->protocolName() != protocolFactory->name())
        return;

    changeNotifier().notify();
}
Esempio n. 4
0
void ContactShared::setPriority(int priority)
{
    ensureLoaded();
    if (Priority != priority)
    {
        Priority = priority;
        changeNotifier().notify();
        emit priorityUpdated();
    }
}
Esempio n. 5
0
void ContactShared::setId(const QString &id)
{
    ensureLoaded();

    if (Id == id)
        return;

    QString oldId = Id;
    Id = id;

    changeNotifier().notify();
}
Esempio n. 6
0
void ContactShared::protocolFactoryUnregistered(ProtocolFactory *protocolFactory)
{
    ensureLoaded();

    if (!protocolFactory || ContactAccount->protocolName() != protocolFactory->name())
        return;

    /* NOTE: This guard is needed to avoid deleting this object when detaching
     * Contact from Buddy which may hold last reference to it and thus wants to
     * delete it. But we don't want this to happen.
     */
    Contact guard(this);
    changeNotifier().notify();
}
Esempio n. 7
0
void ContactShared::init()
{
    Entry = new RosterEntry(this);
    connect(&Entry->hasLocalChangesNotifier(), SIGNAL(changed()), this, SIGNAL(updatedLocally()));

    ContactAccount = new Account();
    OwnerBuddy = new Buddy();

    connect(
        m_protocolsManager, SIGNAL(protocolFactoryRegistered(ProtocolFactory *)), this,
        SLOT(protocolFactoryRegistered(ProtocolFactory *)));
    connect(
        m_protocolsManager, SIGNAL(protocolFactoryUnregistered(ProtocolFactory *)), this,
        SLOT(protocolFactoryUnregistered(ProtocolFactory *)));

    connect(&changeNotifier(), SIGNAL(changed()), this, SLOT(changeNotifierChanged()));
}
Esempio n. 8
0
void ContactShared::setContactAccount(const Account &account)
{
    ensureLoaded();

    if (*ContactAccount == account)
        return;

    if (*ContactAccount && ContactAccount->protocolHandler() && ContactAccount->protocolHandler()->protocolFactory())
        protocolFactoryUnregistered(ContactAccount->protocolHandler()->protocolFactory());

    *ContactAccount = account;

    if (*ContactAccount && ContactAccount->protocolHandler() && ContactAccount->protocolHandler()->protocolFactory())
        protocolFactoryRegistered(ContactAccount->protocolHandler()->protocolFactory());

    changeNotifier().notify();
}
Esempio n. 9
0
void ContactShared::setOwnerBuddy(const Buddy &buddy)
{
    ensureLoaded();

    if (*OwnerBuddy == buddy)
        return;

    /* NOTE: This guard is needed to avoid deleting this object when removing
     * Contact from Buddy which may hold last reference to it and thus wants to
     * delete it. But we don't want this to happen.
     */
    Contact guard(this);

    removeFromBuddy();
    doSetOwnerBuddy(buddy);
    addToBuddy();

    Entry->setHasLocalChanges();
    changeNotifier().notify();

    emit buddyUpdated();
}
Esempio n. 10
0
void ChatShared::init()
{
	ChatAccount = new Account();

	connect(&changeNotifier(), SIGNAL(changed()), this, SIGNAL(updated()));
}
Esempio n. 11
0
MyProximitySensor::MyProximitySensor(QObject *parent) :
    QProximitySensor(parent)
{

    QObject::connect(this,SIGNAL(readingChanged()),this,SLOT(changeNotifier()));
}