1 | /* |
2 | * Copyright (C) 2010 Pau Garcia i Quiles <pgquiles@elpauer.org> |
3 | * Essentially a rip-off of code for Kamoso by: |
4 | * Copyright (C) 2008-2009 by Aleix Pol <aleixpol@kde.org> |
5 | * Copyright (C) 2008-2009 by Alex Fiestas <alex@eyeos.org> |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU Lesser General Public License as published by |
9 | * the Free Software Foundation; either version 2 of the License, or |
10 | * (at your option) any later version. |
11 | * |
12 | * This program is distributed in the hope that it will be useful, |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * GNU General Public License for more details. |
16 | * |
17 | * You should have received a copy of the GNU Lesser General Public License |
18 | * along with this program; if not, write to the Free Software |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 | * Boston, MA 02110-1301, USA. |
21 | */ |
22 | |
23 | #include "ksnapshotimagecollectionshared.h" |
24 | #include <KUrl> |
25 | #include <QtGlobal> |
26 | #include <QDebug> |
27 | #include "ksnapshot.h" |
28 | |
29 | struct KSnapshotImageCollectionShared::Private |
30 | { |
31 | KSnapshot* ksnapshot; |
32 | }; |
33 | |
34 | KSnapshotImageCollectionShared::KSnapshotImageCollectionShared(KSnapshot* ksnapshot): d(new Private), mImages(KUrl::List()) |
35 | { |
36 | d->ksnapshot = ksnapshot; |
37 | } |
38 | |
39 | KSnapshotImageCollectionShared::~KSnapshotImageCollectionShared() |
40 | { |
41 | delete d; |
42 | } |
43 | |
44 | KUrl::List KSnapshotImageCollectionShared::images() |
45 | { |
46 | // TODO (pgquiles) Clean up this mess. I'm not even sure all this is required! |
47 | bool isTempfile = false; |
48 | KUrl url = d->ksnapshot->urlToOpen(&isTempfile); |
49 | if (!url.isValid()) |
50 | { |
51 | return KUrl::List(); |
52 | } |
53 | return KUrl::List(KUrl(url)); |
54 | } |
55 | |