| 1 | /* |
| 2 | * Copyright (C) 2014 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 "request-manager-mock.h" |
| 22 | |
| 23 | #include <QDebug> |
| 24 | |
| 25 | using namespace OnlineAccountsUi; |
| 26 | |
| 27 | static RequestManager *m_instance = 0; |
| 28 | |
| 29 | RequestManagerPrivate::RequestManagerPrivate(RequestManager *q): |
| 30 | QObject(q), |
| 31 | q_ptr(q) |
| 32 | { |
| 33 | } |
| 34 | |
| 35 | RequestManagerPrivate::~RequestManagerPrivate() |
| 36 | { |
| 37 | } |
| 38 | |
| 39 | RequestManager::RequestManager(QObject *parent): |
| 40 | QObject(parent), |
| 41 | d_ptr(new RequestManagerPrivate(this)) |
| 42 | { |
| 43 | m_instance = this; |
| 44 | } |
| 45 | |
| 46 | RequestManager::~RequestManager() |
| 47 | { |
| 48 | m_instance = 0; |
| 49 | } |
| 50 | |
| 51 | RequestManager *RequestManager::instance() |
| 52 | { |
| 53 | return m_instance; |
| 54 | } |
| 55 | |
| 56 | bool RequestManager::isIdle() const |
| 57 | { |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | void RequestManager::enqueue(Request *request) |
| 62 | { |
| 63 | Q_D(RequestManager); |
| 64 | Q_EMIT d->enqueueCalled(request); |
| 65 | } |