Ubuntu Download Manager: /build/ubuntu-download-manager-git/src/ubuntu-download-manager/src/downloads/client/ubuntu/download_manager/manager.cpp Source File

Ubuntu Download Manager 1.2.0 A session-wide downloading service |

manager.cpp
Go to the documentation of this file.
1 /*
2 * Copyright 2013-2014 Canonical Ltd.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19 #include <ubuntu/download_manager/manager_impl.h>
20 #include <ubuntu/download_manager/manager.h>
21
22 namespace {
23 const QString DOWNLOAD_SERVICE = "com.canonical.applications.Downloader";
24 }
25
26 namespace Ubuntu {
27
28 namespace DownloadManager {
29
30 Manager*
31 Manager::createSessionManager(const QString& path, QObject* parent) {
32 if (path.isEmpty()) {
33 return new ManagerImpl(QDBusConnection::sessionBus(), DOWNLOAD_SERVICE, parent);
34 } else {
35 return new ManagerImpl(QDBusConnection::sessionBus(), path, parent);
36 }
37 }
38
39 Manager*
40 Manager::createSystemManager(const QString& path, QObject* parent) {
41 if (path.isEmpty()) {
42 return new ManagerImpl(QDBusConnection::systemBus(), DOWNLOAD_SERVICE, parent);
43 } else {
44 return new ManagerImpl(QDBusConnection::systemBus(), path, parent);
45 }
46 }
47
48
49 } // DownloadManager
50
51 } // Ubuntu
Ubuntu::DownloadManager::Manager::createSystemManager
static Manager * createSystemManager(const QString &path="", QObject *parent=0)
Definition: manager.cpp:40
QObject
Ubuntu
Definition: download.h:26
Ubuntu::DownloadManager::Manager
The Manager class is the entry point of the download manager API and allows the client to create down...
Definition: manager.h:80
Ubuntu::DownloadManager::Manager::createSessionManager
static Manager * createSessionManager(const QString &path="", QObject *parent=0)
Definition: manager.cpp:31
manager.h
manager_impl.h