2
* Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
4
* Author: Tuomo Penttinen <tp@herqq.org>
6
* This file is part of Herqq UPnP Av (HUPnPAv) library.
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.
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.
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/>.
22
#include "hchannelgroupname.h"
24
static bool registerMetaTypes()
26
qRegisterMetaType<Herqq::Upnp::Av::HChannelGroupName>(
27
"Herqq::Upnp::Av::HChannelGroupName");
31
static bool regMetaT = registerMetaTypes();
44
inline bool verifyId(const QString& id)
46
return id.indexOf("_") > 3;
47
// You really cannot express a domain in less than four characters.
51
HChannelGroupName::HChannelGroupName() :
56
HChannelGroupName::HChannelGroupName(const QString& name, const QString& id) :
59
QString idTrimmed = id.trimmed();
60
QString nameTrimmed = name.trimmed();
61
if (!nameTrimmed.isEmpty() && verifyId(idTrimmed))
68
HChannelGroupName::~HChannelGroupName()
72
bool HChannelGroupName::isValid() const
74
return !m_name.isEmpty();
77
bool operator==(const HChannelGroupName& obj1, const HChannelGroupName& obj2)
79
return obj1.id() == obj2.id() &&
80
obj1.name() == obj2.name();