Lomiri Download Manager 0.1.1
A session-wide downloading service
 
Loading...
Searching...
No Matches
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
21
22namespace {
23 const QString DOWNLOAD_SERVICE = "com.lomiri.applications.Downloader";
24}
25
26namespace Lomiri {
27
28namespace DownloadManager {
29
30Manager*
31Manager::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
40Manager::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} // Lomiri
The Manager class is the entry point of the download manager API and allows the client to create down...
Definition manager.h:80
static Manager * createSessionManager(const QString &path="", QObject *parent=0)
Definition manager.cpp:31
static Manager * createSystemManager(const QString &path="", QObject *parent=0)
Definition manager.cpp:40