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

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp/src/devicehosting/messages/hnt_p.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) 2010, 2011 Tuomo Penttinen, all rights reserved.
 
3
 *
 
4
 *  Author: Tuomo Penttinen <tp@herqq.org>
 
5
 *
 
6
 *  This file is part of Herqq UPnP (HUPnP) library.
 
7
 *
 
8
 *  Herqq UPnP is free software: you can redistribute it and/or modify
 
9
 *  it under the terms of the GNU Lesser 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 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 Lesser General Public License for more details.
 
17
 *
 
18
 *  You should have received a copy of the GNU Lesser General Public License
 
19
 *  along with Herqq UPnP. If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
 
 
22
#include "hnt_p.h"
 
23
 
 
24
namespace Herqq
 
25
{
 
26
 
 
27
namespace Upnp
 
28
{
 
29
 
 
30
HNt::HNt() :
 
31
    m_typeValue(qMakePair(Type_Undefined   , QString(""))),
 
32
    m_subTypeValue(qMakePair(SubType_Undefined, QString("")))
 
33
{
 
34
}
 
35
 
 
36
HNt::HNt(const QString& type) :
 
37
    m_typeValue(qMakePair(Type_Undefined, QString(""))),
 
38
    m_subTypeValue(qMakePair(SubType_Undefined, QString("")))
 
39
{
 
40
    if (type.compare("upnp:event", Qt::CaseInsensitive) == 0)
 
41
    {
 
42
        m_typeValue.first  = Type_UpnpEvent;
 
43
        m_typeValue.second = "upnp:event";
 
44
    }
 
45
}
 
46
 
 
47
HNt::HNt(const QString& type, const QString& subtype) :
 
48
    m_typeValue(qMakePair(Type_Undefined, QString(""))),
 
49
    m_subTypeValue(qMakePair(SubType_Undefined, QString("")))
 
50
{
 
51
    if (type.compare("upnp:event", Qt::CaseInsensitive) == 0)
 
52
    {
 
53
        m_typeValue.first  = Type_UpnpEvent;
 
54
        m_typeValue.second = "upnp:event";
 
55
    }
 
56
 
 
57
    if (subtype.compare("upnp:propchange", Qt::CaseInsensitive) == 0)
 
58
    {
 
59
        m_subTypeValue.first  = SubType_UpnpPropChange;
 
60
        m_subTypeValue.second = "upnp:propchange";
 
61
    }
 
62
}
 
63
 
 
64
HNt::HNt(Type type) :
 
65
    m_typeValue(qMakePair(type, toString(type))),
 
66
    m_subTypeValue(qMakePair(SubType_Undefined, QString("")))
 
67
{
 
68
}
 
69
 
 
70
HNt::HNt(Type type, SubType subType) :
 
71
    m_typeValue(qMakePair(type, toString(type))),
 
72
    m_subTypeValue(qMakePair(subType, toString(subType)))
 
73
{
 
74
}
 
75
 
 
76
HNt::~HNt()
 
77
{
 
78
}
 
79
 
 
80
HNt& HNt::operator=(const QString& nt)
 
81
{
 
82
    HNt copy(nt);
 
83
    *this = copy;
 
84
    return *this;
 
85
}
 
86
 
 
87
QString HNt::typeToString() const
 
88
{
 
89
    return m_typeValue.second;
 
90
}
 
91
 
 
92
QString HNt::subTypeToString() const
 
93
{
 
94
    return m_subTypeValue.second;
 
95
}
 
96
 
 
97
QString HNt::toString(Type type)
 
98
{
 
99
    switch(type)
 
100
    {
 
101
    case Type_Undefined:
 
102
        return "";
 
103
    case Type_UpnpEvent:
 
104
        return "upnp:event";
 
105
    }
 
106
 
 
107
    return "";
 
108
}
 
109
 
 
110
QString HNt::toString(SubType subType)
 
111
{
 
112
    switch(subType)
 
113
    {
 
114
    case SubType_Undefined:
 
115
        return "";
 
116
    case SubType_UpnpPropChange:
 
117
        return "upnp:propchange";
 
118
    }
 
119
 
 
120
    return "";
 
121
}
 
122
 
 
123
}
 
124
}