#include <klocale.h>
#include <ksettings.h>
-#include <kdebug.h>
#include <kpluginfactory.h>
+#include <kdebug.h>
static quint16 getRandomPort()
{
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);
#ifndef KDIRSHARE_KDED_H
#define KDIRSHARE_KDED_H
+#include "kdirshareimpl.h"
+
#include <QList>
#include <kdedmodule.h>
-#include "kdirshareimpl.h"
class KDirShareModule: public KDEDModule
{
return start(address, port);
}
-bool KDirShareImpl::publishService()
+bool KDirShareImpl::publish()
{
return m_kdnssd.publishService(
"_http._tcp", m_port,
outheaders->insert("Content-Type", "text/html; charset=UTF-8");
}
}
+
+#include "moc_kdirshareimpl.cpp"
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;