Lomiri Download Manager 0.1.1
A session-wide downloading service
 
Loading...
Searching...
No Matches
downloads_list_impl.cpp
Go to the documentation of this file.
1/*
2 * Copyright 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 "download.h"
20#include "error.h"
21#include "downloads_list_impl.h"
22
23namespace Lomiri {
24
25namespace DownloadManager {
26
27DownloadsListImpl::DownloadsListImpl(QObject* parent)
28 : DownloadsList(parent) {
29}
30
31DownloadsListImpl::DownloadsListImpl(
32 const QList<QSharedPointer<Download> > downs,
33 QObject* parent)
34 : DownloadsList(parent),
35 _downs(downs){
36}
37
38DownloadsListImpl::DownloadsListImpl(Error* err, QObject* parent)
39 : DownloadsList(parent),
40 _lastError(err) {
41}
42
43DownloadsListImpl::~DownloadsListImpl() {
44 delete _lastError;
45}
46
47QList<QSharedPointer<Download> >
48DownloadsListImpl::downloads() const {
49 return _downs;
50}
51
52bool
53DownloadsListImpl::isError() const {
54 return _lastError != nullptr;
55}
56
57Error*
58DownloadsListImpl::error() const {
59 return _lastError;
60}
61
62} // Lomiri
63
64} // DownloadManager