fort/src/ui/conf/addressgroup.cpp

106 lines
2.2 KiB
C++
Raw Normal View History

2017-09-02 10:17:51 +00:00
#include "addressgroup.h"
AddressGroup::AddressGroup(QObject *parent) : QObject(parent) { }
2017-09-02 10:17:51 +00:00
void AddressGroup::setIncludeAll(bool includeAll)
2017-09-02 10:17:51 +00:00
{
if (m_includeAll != includeAll) {
m_includeAll = includeAll;
2019-10-23 12:03:59 +00:00
setEdited(true);
2017-09-02 10:17:51 +00:00
}
}
void AddressGroup::setExcludeAll(bool excludeAll)
2017-09-02 10:17:51 +00:00
{
if (m_excludeAll != excludeAll) {
m_excludeAll = excludeAll;
2019-10-23 12:03:59 +00:00
setEdited(true);
}
}
2023-12-16 05:10:07 +00:00
void AddressGroup::setIncludeZones(quint32 v)
{
if (m_includeZones != v) {
m_includeZones = v;
setEdited(true);
}
}
void AddressGroup::setExcludeZones(quint32 v)
{
if (m_excludeZones != v) {
m_excludeZones = v;
setEdited(true);
}
}
void AddressGroup::setIncludeText(const QString &includeText)
{
if (m_includeText != includeText) {
m_includeText = includeText;
2019-10-23 12:03:59 +00:00
setEdited(true);
}
}
void AddressGroup::setExcludeText(const QString &excludeText)
{
if (m_excludeText != excludeText) {
m_excludeText = excludeText;
2019-10-23 12:03:59 +00:00
setEdited(true);
2017-09-02 10:17:51 +00:00
}
}
2019-10-23 12:03:59 +00:00
void AddressGroup::copy(const AddressGroup &o)
{
2019-12-08 09:50:41 +00:00
m_edited = o.edited();
2019-10-23 12:03:59 +00:00
m_includeAll = o.includeAll();
m_excludeAll = o.excludeAll();
2019-10-27 15:12:59 +00:00
m_id = o.id();
2019-10-23 12:03:59 +00:00
2020-02-13 09:11:25 +00:00
m_includeZones = o.includeZones();
m_excludeZones = o.excludeZones();
m_includeText = o.includeText();
m_excludeText = o.excludeText();
2019-10-23 12:03:59 +00:00
}
QVariant AddressGroup::toVariant() const
{
QVariantMap map;
map["edited"] = edited();
map["includeAll"] = includeAll();
map["excludeAll"] = excludeAll();
map["id"] = id();
map["includeZones"] = includeZones();
map["excludeZones"] = excludeZones();
map["includeText"] = includeText();
map["excludeText"] = excludeText();
return map;
}
void AddressGroup::fromVariant(const QVariant &v)
{
const QVariantMap map = v.toMap();
m_edited = map["edited"].toBool();
m_includeAll = map["includeAll"].toBool();
m_excludeAll = map["excludeAll"].toBool();
m_id = map["id"].toLongLong();
m_includeZones = map["includeZones"].toUInt();
m_excludeZones = map["excludeZones"].toUInt();
m_includeText = map["includeText"].toString();
m_excludeText = map["excludeText"].toString();
}