~ps-jenkins/libaccounts-qt/trusty-proposed

« back to all changes in this revision

Viewing changes to Accounts/account.cpp

  • Committer: Tarmac
  • Author(s): Alberto Mardegan, Ken VanDine, Àlex Fiestas
  • Date: 2013-02-21 11:31:40 UTC
  • mfrom: (120.1.2 packaging)
  • Revision ID: tarmac-20130221113140-2mcjcmag2vbx4lw5
New upstream release.

    - Make libaccounts-qt compile with QT_NO_KEYWORDS
    - Tests: increase coverage (now 93%)
    - Make AccountService::account() always return a valid account
    - Remove excessive debug verbosity
    - Fixed pkg-config requires for accounts-qt5
    - Documentation fixes for out-of-tree builds
.

Approved by PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
 
131
131
Watch::~Watch()
132
132
{
133
 
    TRACE();
134
133
    Account *account = qobject_cast<Account *>(QObject::parent());
135
134
    /* The destructor of Account deletes the child Watches before detaching
136
135
     * them, so here account should always be not NULL */
140
139
 
141
140
void Account::Private::on_display_name_changed(Account *self)
142
141
{
143
 
    TRACE();
144
142
    const gchar *name = ag_account_get_display_name(self->d->m_account);
145
143
 
146
 
    emit self->displayNameChanged(UTF8(name));
 
144
    Q_EMIT self->displayNameChanged(UTF8(name));
147
145
}
148
146
 
149
147
void Account::Private::on_enabled(Account *self, const gchar *service_name,
150
148
                                  gboolean enabled)
151
149
{
152
 
    TRACE();
153
 
 
154
 
    emit self->enabledChanged(UTF8(service_name), enabled);
 
150
    Q_EMIT self->enabledChanged(UTF8(service_name), enabled);
155
151
}
156
152
 
157
153
void Account::Private::on_deleted(Account *self)
158
154
{
159
155
    TRACE();
160
156
 
161
 
    emit self->removed();
 
157
    Q_EMIT self->removed();
162
158
}
163
159
 
164
160
/*!
171
167
    QObject(parent),
172
168
    d(new Private)
173
169
{
174
 
    TRACE();
175
170
    d->m_account = account;
176
171
    g_object_ref(account);
177
172
 
189
184
 */
190
185
Account::~Account()
191
186
{
192
 
    TRACE();
193
 
 
194
187
    QObjectList list = children();
195
188
    for (int i = 0; i < list.count(); i++)
196
189
    {
232
225
 */
233
226
bool Account::supportsService(const QString &serviceType) const
234
227
{
235
 
    TRACE() << serviceType;
236
 
 
237
228
    return ag_account_supports_service(d->m_account,
238
229
                                       serviceType.toUtf8().constData());
239
230
}
248
239
 */
249
240
ServiceList Account::services(const QString &serviceType) const
250
241
{
251
 
    TRACE() << serviceType;
252
 
 
253
242
    GList *list;
254
243
    if (serviceType.isEmpty()) {
255
244
        list = ag_account_list_services(d->m_account);
423
412
    QStringList groups, all_keys;
424
413
 
425
414
    all_keys = allKeys();
426
 
    foreach (QString key, all_keys)
 
415
    Q_FOREACH (QString key, all_keys)
427
416
    {
428
417
        if (key.contains(slash)) {
429
418
            QString group = key.section(slash, 0, 0);
444
433
    QStringList keys, all_keys;
445
434
 
446
435
    all_keys = allKeys();
447
 
    foreach (QString key, all_keys)
 
436
    Q_FOREACH (QString key, all_keys)
448
437
    {
449
438
        if (!key.contains(slash))
450
439
            keys.append(key);
522
511
    {
523
512
        /* delete all keys in the group */
524
513
        QStringList keys = allKeys();
525
 
        foreach (QString key, keys)
 
514
        Q_FOREACH (QString key, keys)
526
515
        {
527
516
            if (!key.isEmpty())
528
517
                remove(key);
545
534
 */
546
535
void Account::setValue(const QString &key, const QVariant &value)
547
536
{
548
 
    TRACE();
549
 
 
550
537
    GVariant *variant = qVariantToGVariant(value);
551
538
    if (variant == 0) {
552
539
        return;
570
557
            error->code == G_IO_ERROR_CANCELLED) {
571
558
            TRACE() << "Account destroyed, operation cancelled";
572
559
        } else {
573
 
            emit self->error(Error(error));
 
560
            Q_EMIT self->error(Error(error));
574
561
        }
575
562
        g_error_free(error);
576
563
    } else {
577
 
        emit self->synced();
 
564
        Q_EMIT self->synced();
578
565
    }
579
566
}
580
567
 
723
710
void Watch::Private::account_notify_cb(AgAccount *account, const gchar *key,
724
711
                                       Watch *watch)
725
712
{
726
 
    emit watch->notify(key);
 
713
    Q_EMIT watch->notify(key);
727
714
 
728
715
    Q_UNUSED(account);
729
716
}
781
768
 */
782
769
void Account::sync()
783
770
{
784
 
    TRACE();
785
 
 
786
771
    ag_account_store_async(d->m_account,
787
772
                           d->m_cancellable,
788
773
                           (GAsyncReadyCallback)&Private::account_store_cb,
798
783
 */
799
784
bool Account::syncAndBlock()
800
785
{
801
 
    TRACE();
802
 
 
803
786
    GError *error = NULL;
804
787
    bool ret;
805
788
 
819
802
 */
820
803
void Account::remove()
821
804
{
822
 
    TRACE();
823
805
    ag_account_delete(d->m_account);
824
806
}
825
807