2
* Copyright 2014 Canonical Ltd.
4
* This file is part of contact-service-app.
6
* contact-service-app is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* contact-service-app is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
//this timeout represents how long the server will wait for changes on the contact before notify the client
21
#define NOTIFY_CONTACTS_TIMEOUT 500
23
#include "dirtycontact-notify.h"
24
#include "addressbook-adaptor.h"
28
DirtyContactsNotify::DirtyContactsNotify(AddressBookAdaptor *adaptor, QObject *parent)
32
m_timer.setInterval(NOTIFY_CONTACTS_TIMEOUT);
33
m_timer.setSingleShot(true);
34
connect(&m_timer, SIGNAL(timeout()), SLOT(onTimeout()));
37
void DirtyContactsNotify::append(QSet<QString> ids)
43
void DirtyContactsNotify::onTimeout()
45
Q_EMIT m_adaptor->contactsUpdated(m_ids.toList());