~saviq/ubuntu-system-settings-online-accounts/new-icon

« back to all changes in this revision

Viewing changes to src/indicator-service.cpp

  • Committer: CI bot
  • Author(s): Alberto Mardegan
  • Date: 2014-06-12 13:37:46 UTC
  • mfrom: (107.1.19 master)
  • Revision ID: ps-jenkins@lists.canonical.com-20140612133746-l203pxlimfpevv6r
New version

- Use signon-ui-service, to fix co-installation with of signon-ui. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * This file is part of online-accounts-ui
3
3
 *
4
 
 * Copyright (C) 2012 Canonical Ltd.
 
4
 * Copyright (C) 2014 Canonical Ltd.
5
5
 *
6
6
 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
7
7
 *
22
22
 
23
23
#include "debug.h"
24
24
#include "i18n.h"
 
25
#include "notification.h"
25
26
#include "reauthenticator.h"
26
27
#include "webcredentials_adaptor.h"
27
28
 
28
29
#include <QByteArray>
29
30
#include <QDBusContext>
30
 
#undef signals
31
 
#include <libnotify/notification.h>
32
 
#include <libnotify/notify.h>
33
31
 
34
32
using namespace OnlineAccountsUi;
35
33
using namespace SignOnUi;
37
35
QDBusArgument &operator<<(QDBusArgument &argument, const QSet<uint> &set)
38
36
{
39
37
    argument.beginArray(qMetaTypeId<uint>());
40
 
    foreach (uint id, set) {
 
38
    Q_FOREACH(uint id, set) {
41
39
        argument << id;
42
40
    }
43
41
    argument.endArray();
109
107
    m_errorStatus(false)
110
108
{
111
109
    qDBusRegisterMetaType< QSet<uint> >();
112
 
    notify_init("webcredentials-indicator");
113
110
}
114
111
 
115
112
void IndicatorServicePrivate::ClearErrorStatus()
229
226
                        "menu to reinstate access to this account.",
230
227
                        SIGNONUI_I18N_DOMAIN);
231
228
 
232
 
    QByteArray summaryUtf8 = summary.toUtf8();
233
 
    QByteArray messageUtf8 = message.toUtf8();
234
 
    NotifyNotification *notification =
235
 
        notify_notification_new(summaryUtf8.constData(),
236
 
                                messageUtf8.constData(),
237
 
                                NULL);
238
 
 
239
 
    GError *error = NULL;
240
 
    if (!notify_notification_show(notification, &error)) {
241
 
        qWarning() << "Couldn't show notification:" << error->message;
242
 
        g_clear_error(&error);
243
 
    }
244
 
 
245
 
    g_object_unref(notification);
 
229
    Notification notification(summary, message);
 
230
    notification.show();
246
231
}
247
232
 
248
233
void IndicatorServicePrivate::notifyPropertyChanged(const char *propertyName)