Ubuntu Download Manager  0.3.0
A session-wide downloading service
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator
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 <QDebug>
20 #include "manager_impl.h"
21 #include "manager.h"
22 
23 namespace {
24  const QString DOWNLOAD_SERVICE = "com.canonical.applications.Downloader";
25 }
26 
27 namespace Ubuntu {
28 
29 namespace DownloadManager {
30 
31 Manager*
32 Manager::createSessionManager(const QString& path, QObject* parent) {
33  if (path.isEmpty()) {
34  return new ManagerImpl(QDBusConnection::sessionBus(), DOWNLOAD_SERVICE, parent);
35  } else {
36  return new ManagerImpl(QDBusConnection::sessionBus(), path, parent);
37  }
38 }
39 
40 Manager*
41 Manager::createSystemManager(const QString& path, QObject* parent) {
42  if (path.isEmpty()) {
43  return new ManagerImpl(QDBusConnection::systemBus(), DOWNLOAD_SERVICE, parent);
44  } else {
45  return new ManagerImpl(QDBusConnection::systemBus(), path, parent);
46  }
47 }
48 
49 
50 } // DownloadManager
51 
52 } // Ubuntu
static Manager * createSessionManager(const QString &path="", QObject *parent=0)
Definition: manager.cpp:32
static Manager * createSystemManager(const QString &path="", QObject *parent=0)
Definition: manager.cpp:41
The Manager class is the entry point of the download manager API and allows the client to create down...
Definition: manager.h:81