| 1 | /* |
| 2 | This file is part of the KDE project |
| 3 | |
| 4 | SPDX-FileCopyrightText: 2004, 2005 Jakub Stachowski <qbast@go2.pl> |
| 5 | |
| 6 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 7 | */ |
| 8 | |
| 9 | #include "publicservice.h" |
| 10 | #include "servicebase_p.h" |
| 11 | #include <QStringList> |
| 12 | |
| 13 | namespace KDNSSD |
| 14 | { |
| 15 | PublicService::PublicService(const QString &name, const QString &type, unsigned int port, const QString &domain, const QStringList &) |
| 16 | : QObject() |
| 17 | , ServiceBase(name, type, QString(), domain, port) |
| 18 | { |
| 19 | if (domain.isNull()) { |
| 20 | d->m_domain = QLatin1String("local." ); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | PublicService::~PublicService() |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | void PublicService::setServiceName(const QString &serviceName) |
| 29 | { |
| 30 | d->m_serviceName = serviceName; |
| 31 | } |
| 32 | |
| 33 | void PublicService::setDomain(const QString &domain) |
| 34 | { |
| 35 | d->m_domain = domain; |
| 36 | } |
| 37 | |
| 38 | void PublicService::setTextData(const QMap<QString, QByteArray> &textData) |
| 39 | { |
| 40 | d->m_textData = textData; |
| 41 | } |
| 42 | |
| 43 | void PublicService::setType(const QString &type) |
| 44 | { |
| 45 | d->m_type = type; |
| 46 | } |
| 47 | |
| 48 | void PublicService::setSubTypes(const QStringList &) |
| 49 | { |
| 50 | // dummy and empty |
| 51 | } |
| 52 | |
| 53 | void PublicService::setPort(unsigned short port) |
| 54 | { |
| 55 | d->m_port = port; |
| 56 | } |
| 57 | |
| 58 | QStringList PublicService::subtypes() const |
| 59 | { |
| 60 | return QStringList(); |
| 61 | } |
| 62 | |
| 63 | bool PublicService::isPublished() const |
| 64 | { |
| 65 | return false; |
| 66 | } |
| 67 | |
| 68 | bool PublicService::publish() |
| 69 | { |
| 70 | return false; |
| 71 | } |
| 72 | |
| 73 | void PublicService::stop() |
| 74 | { |
| 75 | } |
| 76 | |
| 77 | void PublicService::publishAsync() |
| 78 | { |
| 79 | Q_EMIT published(successful: false); |
| 80 | } |
| 81 | |
| 82 | void PublicService::virtual_hook(int, void *) |
| 83 | { |
| 84 | } |
| 85 | |
| 86 | } |
| 87 | |
| 88 | #include "moc_publicservice.cpp" |
| 89 | |