~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/himageitem.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 "himageitem.h"
 
23
#include "himageitem_p.h"
 
24
#include "../../common/hrating.h"
 
25
#include "../../common/hstoragemedium.h"
 
26
#include "../model_mgmt/hcdsproperties.h"
 
27
 
 
28
#include <QtCore/QDateTime>
 
29
#include <QtCore/QStringList>
 
30
 
 
31
namespace Herqq
 
32
{
 
33
 
 
34
namespace Upnp
 
35
{
 
36
 
 
37
namespace Av
 
38
{
 
39
 
 
40
/*******************************************************************************
 
41
 * HImageItemPrivate
 
42
 ******************************************************************************/
 
43
HImageItemPrivate::HImageItemPrivate(
 
44
    const QString& clazz, HObject::CdsType cdsType) :
 
45
        HItemPrivate(clazz, cdsType)
 
46
{
 
47
    const HCdsProperties& inst = HCdsProperties::instance();
 
48
    insert(inst.get(HCdsProperties::upnp_longDescription));
 
49
    insert(inst.get(HCdsProperties::upnp_storageMedium));
 
50
    insert(inst.get(HCdsProperties::upnp_rating));
 
51
    insert(inst.get(HCdsProperties::dc_description));
 
52
    insert(inst.get(HCdsProperties::dc_publisher));
 
53
    insert(inst.get(HCdsProperties::dc_date));
 
54
    insert(inst.get(HCdsProperties::dc_rights));
 
55
}
 
56
 
 
57
/*******************************************************************************
 
58
 * HImageItem
 
59
 ******************************************************************************/
 
60
HImageItem::HImageItem(const QString& clazz, HObject::CdsType cdsType) :
 
61
    HItem(*new HImageItemPrivate(clazz, cdsType))
 
62
{
 
63
}
 
64
 
 
65
HImageItem::HImageItem(HImageItemPrivate& dd) :
 
66
    HItem(dd)
 
67
{
 
68
}
 
69
 
 
70
HImageItem::HImageItem(
 
71
    const QString& title, const QString& parentId, const QString& id) :
 
72
        HItem(*new HImageItemPrivate(sClass(), sType()))
 
73
{
 
74
    init(title, parentId, id);
 
75
}
 
76
 
 
77
HImageItem::~HImageItem()
 
78
{
 
79
}
 
80
 
 
81
HImageItem* HImageItem::newInstance() const
 
82
{
 
83
    return new HImageItem();
 
84
}
 
85
 
 
86
QString HImageItem::longDescription() const
 
87
{
 
88
    QVariant value;
 
89
    getCdsProperty(HCdsProperties::upnp_longDescription, &value);
 
90
    return value.toString();
 
91
}
 
92
 
 
93
HStorageMedium HImageItem::storageMedium() const
 
94
{
 
95
    QVariant value;
 
96
    getCdsProperty(HCdsProperties::upnp_storageMedium, &value);
 
97
    return value.value<HStorageMedium>();
 
98
}
 
99
 
 
100
QList<HRating> HImageItem::ratings() const
 
101
{
 
102
    QVariant value;
 
103
    getCdsProperty(HCdsProperties::upnp_rating, &value);
 
104
    return toList<HRating>(value.toList());
 
105
}
 
106
 
 
107
QString HImageItem::description() const
 
108
{
 
109
    QVariant value;
 
110
    getCdsProperty(HCdsProperties::dc_description, &value);
 
111
    return value.toString();
 
112
}
 
113
 
 
114
QStringList HImageItem::publishers() const
 
115
{
 
116
    QVariant value;
 
117
    getCdsProperty(HCdsProperties::dc_publisher, &value);
 
118
    return value.toStringList();
 
119
}
 
120
 
 
121
QDateTime HImageItem::date() const
 
122
{
 
123
    QVariant value;
 
124
    getCdsProperty(HCdsProperties::dc_date, &value);
 
125
    return value.toDateTime();
 
126
}
 
127
 
 
128
QStringList HImageItem::rights() const
 
129
{
 
130
    QVariant value;
 
131
    getCdsProperty(HCdsProperties::dc_rights, &value);
 
132
    return value.toStringList();
 
133
}
 
134
 
 
135
void HImageItem::setLongDescription(const QString& arg)
 
136
{
 
137
    setCdsProperty(HCdsProperties::upnp_longDescription, QVariant::fromValue(arg));
 
138
}
 
139
 
 
140
void HImageItem::setStorageMedium(const HStorageMedium& arg)
 
141
{
 
142
    setCdsProperty(HCdsProperties::upnp_storageMedium, QVariant::fromValue(arg));
 
143
}
 
144
 
 
145
void HImageItem::setRatings(const QList<HRating>& arg)
 
146
{
 
147
    setCdsProperty(HCdsProperties::upnp_rating, toList(arg));
 
148
}
 
149
 
 
150
void HImageItem::setDescription(const QString& arg)
 
151
{
 
152
    setCdsProperty(HCdsProperties::dc_description, QVariant::fromValue(arg));
 
153
}
 
154
 
 
155
void HImageItem::setPublishers(const QStringList& arg)
 
156
{
 
157
    setCdsProperty(HCdsProperties::dc_publisher, QVariant::fromValue(arg));
 
158
}
 
159
 
 
160
void HImageItem::setDate(const QDateTime& arg)
 
161
{
 
162
    setCdsProperty(HCdsProperties::dc_date, QVariant::fromValue(arg));
 
163
}
 
164
 
 
165
void HImageItem::setRights(const QStringList& arg)
 
166
{
 
167
    setCdsProperty(HCdsProperties::dc_rights, QVariant::fromValue(arg));
 
168
}
 
169
 
 
170
}
 
171
}
 
172
}