| 1 | /* |
| 2 | * Copyright (C) 2013 Canonical Ltd. |
| 3 | * |
| 4 | * Contact: Alberto Mardegan <[email protected]> |
| 5 | * |
| 6 | * This file is part of lomiri-online-accounts-service |
| 7 | * |
| 8 | * This program is free software: you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License version 3, as published |
| 10 | * by the Free Software Foundation. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranties of |
| 14 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
| 15 | * PURPOSE. See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #include <online-accounts-common/debug.h> |
| 22 | #include <online-accounts-common/globals.h> |
| 23 | #include "onlineaccountsuiadaptor.h" |
| 24 | #include "request.h" |
| 25 | #include "request-manager.h" |
| 26 | #include "service.h" |
| 27 | |
| 28 | using namespace OnlineAccountsUi; |
| 29 | |
| 30 | Service::Service(QObject *parent): |
| 31 | QObject(parent) |
| 32 | { |
| 33 | new OnlineAccountsUiAdaptor(this); |
| 34 | } |
| 35 | |
| 36 | Service::~Service() |
| 37 | { |
| 38 | } |
| 39 | |
| 40 | QVariantMap Service::requestAccess(const QVariantMap &options) |
| 41 | { |
| 42 | DEBUG() << "Got request:" << options; |
| 43 | |
| 44 | /* The following line tells QtDBus not to generate a reply now */ |
| 45 | setDelayedReply(true); |
| 46 | |
| 47 | Request *request = new Request(connection(), message(), options, this); |
| 48 | RequestManager *manager = RequestManager::instance(); |
| 49 | manager->enqueue(request); |
| 50 | |
| 51 | return QVariantMap(); |
| 52 | } |