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

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp_av/src/contentdirectory/hsearchresult.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-09-27 21:41:30 UTC
  • mfrom: (1.2.43)
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: package-import@ubuntu.com-20120927214130-i8v3ufr21nesp29i
Tags: 4:3.0.0~beta1a-1
* New upstream release

* Fix "wrongly conflicts phonon-backend-vlc" dropped (Closes: #688142)
* debian/watch include download.kde.org

* digikam 3.0.0 uses features from unreleased kdegraphics >=4.10 & ships 
a private version of the kdegraphics libs - this is not the Debian way :-(
* Unsatisfactory Conflicts: libkipi8, libkexiv2-10, libkdcraw20, libksane0
* Suspend digikam-dbg >130Mb

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 "hsearchresult.h"
 
23
 
 
24
#include <QtCore/QString>
 
25
 
 
26
namespace Herqq
 
27
{
 
28
 
 
29
namespace Upnp
 
30
{
 
31
 
 
32
namespace Av
 
33
{
 
34
 
 
35
class HSearchResultPrivate :
 
36
    public QSharedData
 
37
{
 
38
H_DISABLE_ASSIGN(HSearchResultPrivate)
 
39
 
 
40
public:
 
41
 
 
42
    QString m_result;
 
43
    quint32 m_numberReturned;
 
44
    quint32 m_totalMatches;
 
45
    quint32 m_updateId;
 
46
 
 
47
    HSearchResultPrivate() :
 
48
        m_result(), m_numberReturned(0), m_totalMatches(0), m_updateId(0)
 
49
    {
 
50
    }
 
51
 
 
52
    HSearchResultPrivate(
 
53
        const QString& result, quint32 numberReturned, quint32 totalMatches,
 
54
        quint32 updateId) :
 
55
            m_result(result), m_numberReturned(numberReturned),
 
56
            m_totalMatches(totalMatches), m_updateId(updateId)
 
57
    {
 
58
    }
 
59
};
 
60
 
 
61
HSearchResult::HSearchResult() :
 
62
    h_ptr(new HSearchResultPrivate())
 
63
{
 
64
}
 
65
 
 
66
HSearchResult::HSearchResult(
 
67
    const QString& result, quint32 numberReturned, quint32 totalMatches,
 
68
    quint32 updateId) :
 
69
        h_ptr(new HSearchResultPrivate(result, numberReturned, totalMatches, updateId))
 
70
{
 
71
}
 
72
 
 
73
HSearchResult::HSearchResult(const HSearchResult& other) :
 
74
    h_ptr(other.h_ptr)
 
75
{
 
76
    Q_ASSERT(this != &other);
 
77
}
 
78
 
 
79
HSearchResult& HSearchResult::operator=(const HSearchResult& other)
 
80
{
 
81
    Q_ASSERT(this != &other);
 
82
    h_ptr = other.h_ptr;
 
83
    return *this;
 
84
}
 
85
 
 
86
HSearchResult::~HSearchResult()
 
87
{
 
88
}
 
89
 
 
90
QString HSearchResult::result() const
 
91
{
 
92
    return h_ptr->m_result;
 
93
}
 
94
 
 
95
quint32 HSearchResult::numberReturned() const
 
96
{
 
97
    return h_ptr->m_numberReturned;
 
98
}
 
99
 
 
100
quint32 HSearchResult::totalMatches() const
 
101
{
 
102
    return h_ptr->m_totalMatches;
 
103
}
 
104
 
 
105
quint32 HSearchResult::updateId() const
 
106
{
 
107
    return h_ptr->m_updateId;
 
108
}
 
109
 
 
110
bool operator==(const HSearchResult& obj1, const HSearchResult& obj2)
 
111
{
 
112
    return obj1.numberReturned() == obj2.numberReturned() &&
 
113
           obj1.result() == obj2.result() &&
 
114
           obj1.totalMatches() == obj2.totalMatches() &&
 
115
           obj1.updateId() == obj2.updateId();
 
116
}
 
117
 
 
118
}
 
119
}
 
120
}