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; }
void ContactShared::aboutToBeRemoved() { // clean up references removeFromBuddy(); doSetOwnerBuddy(Buddy::null); changeNotifier().notify(); }
void ContactShared::protocolFactoryRegistered(ProtocolFactory *protocolFactory) { ensureLoaded(); if (!protocolFactory || !*ContactAccount || ContactAccount->protocolName() != protocolFactory->name()) return; changeNotifier().notify(); }
void ContactShared::setPriority(int priority) { ensureLoaded(); if (Priority != priority) { Priority = priority; changeNotifier().notify(); emit priorityUpdated(); } }
void ContactShared::setId(const QString &id) { ensureLoaded(); if (Id == id) return; QString oldId = Id; Id = id; changeNotifier().notify(); }
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(); }
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())); }
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(); }
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(); }
void ChatShared::init() { ChatAccount = new Account(); connect(&changeNotifier(), SIGNAL(changed()), this, SIGNAL(updated())); }
MyProximitySensor::MyProximitySensor(QObject *parent) : QProximitySensor(parent) { QObject::connect(this,SIGNAL(readingChanged()),this,SLOT(changeNotifier())); }