1 | /* |
2 | * Copyright (C) 2011 Tuomo Penttinen, all rights reserved. |
3 | * |
4 | * Author: Tuomo Penttinen <tp@herqq.org> |
5 | * |
6 | * This file is part of Herqq UPnP Av (HUPnPAv) library. |
7 | * |
8 | * Herqq UPnP Av is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * (at your option) any later version. |
12 | * |
13 | * Herqq UPnP Av is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
19 | * along with Herqq UPnP Av. If not, see <http://www.gnu.org/licenses/>. |
20 | */ |
21 | |
22 | #include "hphoto.h" |
23 | #include "hphoto_p.h" |
24 | #include "../model_mgmt/hcdsproperties.h" |
25 | |
26 | #include <QtCore/QStringList> |
27 | |
28 | namespace Herqq |
29 | { |
30 | |
31 | namespace Upnp |
32 | { |
33 | |
34 | namespace Av |
35 | { |
36 | |
37 | /******************************************************************************* |
38 | * HPhotoPrivate |
39 | ******************************************************************************/ |
40 | HPhotoPrivate::HPhotoPrivate( |
41 | const QString& clazz, HObject::CdsType cdsType) : |
42 | HImageItemPrivate(clazz, cdsType) |
43 | { |
44 | const HCdsProperties& inst = HCdsProperties::instance(); |
45 | insert(inst.get(HCdsProperties::upnp_album)); |
46 | } |
47 | |
48 | /******************************************************************************* |
49 | * HPhoto |
50 | ******************************************************************************/ |
51 | HPhoto::HPhoto(const QString& clazz, CdsType cdsType) : |
52 | HImageItem(*new HPhotoPrivate(clazz, cdsType)) |
53 | { |
54 | } |
55 | |
56 | HPhoto::HPhoto( |
57 | const QString& title, const QString& parentId, const QString& id) : |
58 | HImageItem(*new HPhotoPrivate(sClass(), sType())) |
59 | { |
60 | init(title, parentId, id); |
61 | } |
62 | |
63 | HPhoto::~HPhoto() |
64 | { |
65 | } |
66 | |
67 | HPhoto* HPhoto::newInstance() const |
68 | { |
69 | return new HPhoto(); |
70 | } |
71 | |
72 | void HPhoto::setAlbums(const QStringList& arg) |
73 | { |
74 | setCdsProperty(HCdsProperties::upnp_album, arg); |
75 | } |
76 | |
77 | QStringList HPhoto::albums() const |
78 | { |
79 | QVariant value; |
80 | getCdsProperty(HCdsProperties::upnp_album, &value); |
81 | return value.toStringList(); |
82 | } |
83 | |
84 | } |
85 | } |
86 | } |
87 | |