From 2ebe90b420b9f36d9e1f9513e5ab2c8e2ea7a5cf Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 9 May 2022 19:04:29 +0300 Subject: [PATCH] kdirshare: minor review Signed-off-by: Ivailo Monev --- kdirshare/kded/kded_kdirshare.cpp | 4 ++-- kdirshare/kded/kded_kdirshare.h | 3 ++- kdirshare/kded/kdirshareimpl.cpp | 4 +++- kdirshare/kded/kdirshareimpl.h | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/kdirshare/kded/kded_kdirshare.cpp b/kdirshare/kded/kded_kdirshare.cpp index 1fe34367..94b5256a 100644 --- a/kdirshare/kded/kded_kdirshare.cpp +++ b/kdirshare/kded/kded_kdirshare.cpp @@ -20,8 +20,8 @@ #include #include -#include #include +#include static quint16 getRandomPort() { @@ -71,7 +71,7 @@ QString KDirShareModule::share(const QString &dirpath) kdirshareimpl->deleteLater(); return i18n("Could not serve: %1", kdirshareimpl->errorString()); } - if (!kdirshareimpl->publishService()) { + if (!kdirshareimpl->publish()) { kdirshareimpl->stop(); kdirshareimpl->deleteLater(); return i18n("Could not publish service for: %1", dirpath); diff --git a/kdirshare/kded/kded_kdirshare.h b/kdirshare/kded/kded_kdirshare.h index f46b8453..896ce9fc 100644 --- a/kdirshare/kded/kded_kdirshare.h +++ b/kdirshare/kded/kded_kdirshare.h @@ -19,9 +19,10 @@ #ifndef KDIRSHARE_KDED_H #define KDIRSHARE_KDED_H +#include "kdirshareimpl.h" + #include #include -#include "kdirshareimpl.h" class KDirShareModule: public KDEDModule { diff --git a/kdirshare/kded/kdirshareimpl.cpp b/kdirshare/kded/kdirshareimpl.cpp index 4ab1a6d7..c4c43b77 100644 --- a/kdirshare/kded/kdirshareimpl.cpp +++ b/kdirshare/kded/kdirshareimpl.cpp @@ -128,7 +128,7 @@ bool KDirShareImpl::serve(const QHostAddress &address, const quint16 port) return start(address, port); } -bool KDirShareImpl::publishService() +bool KDirShareImpl::publish() { return m_kdnssd.publishService( "_http._tcp", m_port, @@ -179,3 +179,5 @@ void KDirShareImpl::respond(const QByteArray &url, QByteArray *outdata, ushort * outheaders->insert("Content-Type", "text/html; charset=UTF-8"); } } + +#include "moc_kdirshareimpl.cpp" diff --git a/kdirshare/kded/kdirshareimpl.h b/kdirshare/kded/kdirshareimpl.h index 19f15f3a..562261a1 100644 --- a/kdirshare/kded/kdirshareimpl.h +++ b/kdirshare/kded/kdirshareimpl.h @@ -32,7 +32,7 @@ public: QString directory() const; bool setDirectory(const QString &dirpath); bool serve(const QHostAddress &address, const quint16 port); - bool publishService(); + bool publish(); protected: void respond(const QByteArray &url, QByteArray *outdata, ushort *outhttpstatus, KHTTPHeaders *outheaders) final; -- 2.11.0