~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp_av/src/cds_model/cds_objects/htextitem.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 "htextitem.h"
 
23
#include "htextitem_p.h"
 
24
 
 
25
#include "../hpersonwithrole.h"
 
26
#include "../model_mgmt/hcdsproperties.h"
 
27
 
 
28
#include "../../common/hrating.h"
 
29
#include "../../common/hstoragemedium.h"
 
30
 
 
31
#include <QtCore/QUrl>
 
32
#include <QtCore/QDateTime>
 
33
#include <QtCore/QStringList>
 
34
 
 
35
namespace Herqq
 
36
{
 
37
 
 
38
namespace Upnp
 
39
{
 
40
 
 
41
namespace Av
 
42
{
 
43
 
 
44
/*******************************************************************************
 
45
 * HTextItemPrivate
 
46
 ******************************************************************************/
 
47
HTextItemPrivate::HTextItemPrivate(
 
48
    const QString& clazz, HObject::CdsType cdsType) :
 
49
        HItemPrivate(clazz, cdsType)
 
50
{
 
51
    const HCdsProperties& inst = HCdsProperties::instance();
 
52
    insert(inst.get(HCdsProperties::upnp_author));
 
53
    insert(inst.get(HCdsProperties::upnp_longDescription));
 
54
    insert(inst.get(HCdsProperties::upnp_storageMedium));
 
55
    insert(inst.get(HCdsProperties::upnp_rating));
 
56
    insert(inst.get(HCdsProperties::dc_description));
 
57
    insert(inst.get(HCdsProperties::dc_publisher));
 
58
    insert(inst.get(HCdsProperties::dc_contributor));
 
59
    insert(inst.get(HCdsProperties::dc_date));
 
60
    insert(inst.get(HCdsProperties::dc_relation));
 
61
    insert(inst.get(HCdsProperties::dc_language));
 
62
    insert(inst.get(HCdsProperties::dc_rights));
 
63
}
 
64
 
 
65
/*******************************************************************************
 
66
 * HTextItem
 
67
 ******************************************************************************/
 
68
HTextItem::HTextItem(const QString& clazz, CdsType cdsType) :
 
69
    HItem(*new HTextItemPrivate(clazz, cdsType))
 
70
{
 
71
}
 
72
 
 
73
HTextItem::HTextItem(
 
74
    const QString& title, const QString& parentId, const QString& id) :
 
75
        HItem(*new HTextItemPrivate(sClass(), sType()))
 
76
{
 
77
    init(title, parentId, id);
 
78
}
 
79
 
 
80
HTextItem::~HTextItem()
 
81
{
 
82
}
 
83
 
 
84
HTextItem* HTextItem::newInstance() const
 
85
{
 
86
    return new HTextItem();
 
87
}
 
88
 
 
89
QList<HPersonWithRole> HTextItem::authors() const
 
90
{
 
91
    QVariant value;
 
92
    getCdsProperty(HCdsProperties::upnp_author, &value);
 
93
    return toList<HPersonWithRole>(value.toList());
 
94
}
 
95
 
 
96
QString HTextItem::longDescription() const
 
97
{
 
98
    QVariant value;
 
99
    getCdsProperty(HCdsProperties::upnp_longDescription, &value);
 
100
    return value.toString();
 
101
}
 
102
 
 
103
HStorageMedium HTextItem::storageMedium() const
 
104
{
 
105
    QVariant value;
 
106
    getCdsProperty(HCdsProperties::upnp_storageMedium, &value);
 
107
    return value.value<HStorageMedium>();
 
108
}
 
109
 
 
110
QList<HRating> HTextItem::ratings() const
 
111
{
 
112
    QVariant value;
 
113
    getCdsProperty(HCdsProperties::upnp_rating, &value);
 
114
    return toList<HRating>(value.toList());
 
115
}
 
116
 
 
117
QString HTextItem::description() const
 
118
{
 
119
    QVariant value;
 
120
    getCdsProperty(HCdsProperties::dc_description, &value);
 
121
    return value.toString();
 
122
}
 
123
 
 
124
QStringList HTextItem::publishers() const
 
125
{
 
126
    QVariant value;
 
127
    getCdsProperty(HCdsProperties::dc_publisher, &value);
 
128
    return value.toStringList();
 
129
}
 
130
 
 
131
QStringList HTextItem::contributors() const
 
132
{
 
133
    QVariant value;
 
134
    getCdsProperty(HCdsProperties::dc_contributor, &value);
 
135
    return value.toStringList();
 
136
}
 
137
 
 
138
QDateTime HTextItem::date() const
 
139
{
 
140
    QVariant value;
 
141
    getCdsProperty(HCdsProperties::dc_date, &value);
 
142
    return value.toDateTime();
 
143
}
 
144
 
 
145
QList<QUrl> HTextItem::relations() const
 
146
{
 
147
    QVariant value;
 
148
    getCdsProperty(HCdsProperties::dc_relation, &value);
 
149
    return toList<QUrl>(value.toList());
 
150
}
 
151
 
 
152
QStringList HTextItem::languages() const
 
153
{
 
154
    QVariant value;
 
155
    getCdsProperty(HCdsProperties::dc_language, &value);
 
156
    return value.toStringList();
 
157
}
 
158
 
 
159
QStringList HTextItem::rights() const
 
160
{
 
161
    QVariant value;
 
162
    getCdsProperty(HCdsProperties::dc_rights, &value);
 
163
    return value.toStringList();
 
164
}
 
165
 
 
166
void HTextItem::setAuthors(const QList<HPersonWithRole>& arg)
 
167
{
 
168
    setCdsProperty(HCdsProperties::upnp_author, toList(arg));
 
169
}
 
170
 
 
171
void HTextItem::setLongDescription(const QString& arg)
 
172
{
 
173
    setCdsProperty(HCdsProperties::upnp_longDescription, arg);
 
174
}
 
175
 
 
176
void HTextItem::setStorageMedium(const HStorageMedium& arg)
 
177
{
 
178
    setCdsProperty(HCdsProperties::upnp_storageMedium, QVariant::fromValue(arg));
 
179
}
 
180
 
 
181
void HTextItem::setRatings(const QList<HRating>& arg)
 
182
{
 
183
    setCdsProperty(HCdsProperties::upnp_rating, toList(arg));
 
184
}
 
185
 
 
186
void HTextItem::setDescription(const QString& arg)
 
187
{
 
188
    setCdsProperty(HCdsProperties::dc_description, arg);
 
189
}
 
190
 
 
191
void HTextItem::setPublishers(const QStringList& arg)
 
192
{
 
193
    setCdsProperty(HCdsProperties::dc_publisher, arg);
 
194
}
 
195
 
 
196
void HTextItem::setContributors(const QStringList& arg)
 
197
{
 
198
    setCdsProperty(HCdsProperties::dc_contributor, arg);
 
199
}
 
200
 
 
201
void HTextItem::setDate(const QDateTime& arg)
 
202
{
 
203
    setCdsProperty(HCdsProperties::dc_date, arg);
 
204
}
 
205
 
 
206
void HTextItem::setRelations(const QList<QUrl>& arg)
 
207
{
 
208
    setCdsProperty(HCdsProperties::dc_relation, toList(arg));
 
209
}
 
210
 
 
211
void HTextItem::setLanguages(const QStringList& arg)
 
212
{
 
213
    setCdsProperty(HCdsProperties::dc_language, arg);
 
214
}
 
215
 
 
216
void HTextItem::setRights(const QStringList& arg)
 
217
{
 
218
    setCdsProperty(HCdsProperties::dc_rights, arg);
 
219
}
 
220
 
 
221
}
 
222
}
 
223
}