forked from jbagg/QtZeroConf
fix indentations in QZeroConfService
This commit is contained in:
@@ -4,15 +4,15 @@
|
|||||||
class QZeroConfServiceData : public QSharedData
|
class QZeroConfServiceData : public QSharedData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QString name;
|
QString name;
|
||||||
QString type;
|
QString type;
|
||||||
QString domain;
|
QString domain;
|
||||||
QString host;
|
QString host;
|
||||||
QHostAddress ip;
|
QHostAddress ip;
|
||||||
QHostAddress ipv6;
|
QHostAddress ipv6;
|
||||||
quint32 interfaceIndex;
|
quint32 interfaceIndex;
|
||||||
quint16 port = 0;
|
quint16 port = 0;
|
||||||
QMap <QByteArray, QByteArray> txt;
|
QMap <QByteArray, QByteArray> txt;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -28,9 +28,9 @@ QZeroConfService::QZeroConfService(const QZeroConfService &rhs) : data(rhs.data)
|
|||||||
|
|
||||||
QZeroConfService &QZeroConfService::operator=(const QZeroConfService &rhs)
|
QZeroConfService &QZeroConfService::operator=(const QZeroConfService &rhs)
|
||||||
{
|
{
|
||||||
if (this != &rhs)
|
if (this != &rhs)
|
||||||
data.operator=(rhs.data);
|
data.operator=(rhs.data);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
QZeroConfService::~QZeroConfService()
|
QZeroConfService::~QZeroConfService()
|
||||||
@@ -40,106 +40,105 @@ QZeroConfService::~QZeroConfService()
|
|||||||
|
|
||||||
QString QZeroConfService::name() const
|
QString QZeroConfService::name() const
|
||||||
{
|
{
|
||||||
return data->name;
|
return data->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZeroConfService::setName(const QString &name)
|
void QZeroConfService::setName(const QString &name)
|
||||||
{
|
{
|
||||||
data->name = name;
|
data->name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QZeroConfService::type() const
|
QString QZeroConfService::type() const
|
||||||
{
|
{
|
||||||
return data->type;
|
return data->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZeroConfService::setType(const QString &type)
|
void QZeroConfService::setType(const QString &type)
|
||||||
{
|
{
|
||||||
data->type = type;
|
data->type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QZeroConfService::domain() const
|
QString QZeroConfService::domain() const
|
||||||
{
|
{
|
||||||
return data->domain;
|
return data->domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZeroConfService::setDomain(const QString &domain)
|
void QZeroConfService::setDomain(const QString &domain)
|
||||||
{
|
{
|
||||||
data->domain = domain;
|
data->domain = domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QZeroConfService::host() const
|
QString QZeroConfService::host() const
|
||||||
{
|
{
|
||||||
return data->host;
|
return data->host;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZeroConfService::setHost(const QString &host)
|
void QZeroConfService::setHost(const QString &host)
|
||||||
{
|
{
|
||||||
data->host = host;
|
data->host = host;
|
||||||
}
|
}
|
||||||
|
|
||||||
QHostAddress QZeroConfService::ip() const
|
QHostAddress QZeroConfService::ip() const
|
||||||
{
|
{
|
||||||
return data->ip;
|
return data->ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZeroConfService::setIp(QHostAddress &ip)
|
void QZeroConfService::setIp(QHostAddress &ip)
|
||||||
{
|
{
|
||||||
data->ip = ip;
|
data->ip = ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
QHostAddress QZeroConfService::ipv6() const
|
QHostAddress QZeroConfService::ipv6() const
|
||||||
{
|
{
|
||||||
return data->ipv6;
|
return data->ipv6;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZeroConfService::setIpv6(const QHostAddress &ipv6)
|
void QZeroConfService::setIpv6(const QHostAddress &ipv6)
|
||||||
{
|
{
|
||||||
data->ipv6 = ipv6;
|
data->ipv6 = ipv6;
|
||||||
}
|
}
|
||||||
|
|
||||||
quint32 QZeroConfService::interfaceIndex() const
|
quint32 QZeroConfService::interfaceIndex() const
|
||||||
{
|
{
|
||||||
return data->interfaceIndex;
|
return data->interfaceIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZeroConfService::setInterfaceIndex(const quint32 &interfaceIndex)
|
void QZeroConfService::setInterfaceIndex(const quint32 &interfaceIndex)
|
||||||
{
|
{
|
||||||
data->interfaceIndex = interfaceIndex;
|
data->interfaceIndex = interfaceIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
quint16 QZeroConfService::port() const
|
quint16 QZeroConfService::port() const
|
||||||
{
|
{
|
||||||
return data->port;
|
return data->port;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZeroConfService::setPort(const quint16 port)
|
void QZeroConfService::setPort(const quint16 port)
|
||||||
{
|
{
|
||||||
data->port = port;
|
data->port = port;
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<QByteArray, QByteArray> QZeroConfService::txt() const
|
QMap<QByteArray, QByteArray> QZeroConfService::txt() const
|
||||||
{
|
{
|
||||||
return data->txt;
|
return data->txt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZeroConfService::setTxt(const QMap<QByteArray, QByteArray> txt)
|
void QZeroConfService::setTxt(const QMap<QByteArray, QByteArray> txt)
|
||||||
{
|
{
|
||||||
data->txt = txt;
|
data->txt = txt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZeroConfService::appendTxt(QByteArray idx, QByteArray val)
|
void QZeroConfService::appendTxt(QByteArray idx, QByteArray val)
|
||||||
{
|
{
|
||||||
data->txt[idx] = val;
|
data->txt[idx] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QZeroConfService::isValid() const
|
bool QZeroConfService::isValid() const
|
||||||
{
|
{
|
||||||
|
return (!data->name.isEmpty());
|
||||||
return (!data->name.isEmpty());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QZeroConfService::operator==(const QZeroConfService &rhs) const
|
bool QZeroConfService::operator==(const QZeroConfService &rhs) const
|
||||||
{
|
{
|
||||||
return this->name() == rhs.name() && (this->ip() == rhs.ip() || this->ipv6() == rhs.ipv6());
|
return this->name() == rhs.name() && (this->ip() == rhs.ip() || this->ipv6() == rhs.ipv6());
|
||||||
}
|
}
|
||||||
|
@@ -8,45 +8,45 @@ class QZeroConfServiceData;
|
|||||||
|
|
||||||
class QZeroConfService
|
class QZeroConfService
|
||||||
{
|
{
|
||||||
Q_GADGET
|
Q_GADGET
|
||||||
Q_PROPERTY( QString name READ name )
|
Q_PROPERTY( QString name READ name )
|
||||||
Q_PROPERTY( QString type READ type )
|
Q_PROPERTY( QString type READ type )
|
||||||
Q_PROPERTY( QString domain READ domain )
|
Q_PROPERTY( QString domain READ domain )
|
||||||
Q_PROPERTY( QString host READ host )
|
Q_PROPERTY( QString host READ host )
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
QZeroConfService();
|
QZeroConfService();
|
||||||
QZeroConfService(const QZeroConfService &);
|
QZeroConfService(const QZeroConfService &);
|
||||||
QZeroConfService &operator=(const QZeroConfService &);
|
QZeroConfService &operator=(const QZeroConfService &);
|
||||||
~QZeroConfService();
|
~QZeroConfService();
|
||||||
|
|
||||||
|
|
||||||
QString name() const;
|
QString name() const;
|
||||||
void setName(const QString &name);
|
void setName(const QString &name);
|
||||||
QString type() const;
|
QString type() const;
|
||||||
void setType(const QString &type);
|
void setType(const QString &type);
|
||||||
QString domain() const;
|
QString domain() const;
|
||||||
void setDomain(const QString &domain);
|
void setDomain(const QString &domain);
|
||||||
QString host() const;
|
QString host() const;
|
||||||
void setHost(const QString &host);
|
void setHost(const QString &host);
|
||||||
QHostAddress ip() const;
|
QHostAddress ip() const;
|
||||||
void setIp(QHostAddress &ip);
|
void setIp(QHostAddress &ip);
|
||||||
QHostAddress ipv6() const;
|
QHostAddress ipv6() const;
|
||||||
void setIpv6(const QHostAddress &ipv6);
|
void setIpv6(const QHostAddress &ipv6);
|
||||||
quint32 interfaceIndex() const;
|
quint32 interfaceIndex() const;
|
||||||
void setInterfaceIndex(const quint32 &interfaceIndex);
|
void setInterfaceIndex(const quint32 &interfaceIndex);
|
||||||
quint16 port() const;
|
quint16 port() const;
|
||||||
void setPort(const quint16 port);
|
void setPort(const quint16 port);
|
||||||
QMap <QByteArray, QByteArray> txt() const;
|
QMap <QByteArray, QByteArray> txt() const;
|
||||||
void setTxt(const QMap<QByteArray, QByteArray> txt);
|
void setTxt(const QMap<QByteArray, QByteArray> txt);
|
||||||
void appendTxt(QByteArray idx, QByteArray val = "");
|
void appendTxt(QByteArray idx, QByteArray val = "");
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
bool operator==(const QZeroConfService &rhs) const;
|
bool operator==(const QZeroConfService &rhs) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSharedDataPointer<QZeroConfServiceData> data;
|
QSharedDataPointer<QZeroConfServiceData> data;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QZeroConfService)
|
Q_DECLARE_METATYPE(QZeroConfService)
|
||||||
|
Reference in New Issue
Block a user