mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kdirshare: adjust to KHTTP changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
1c4fee822d
commit
aeeae815ba
3 changed files with 9 additions and 4 deletions
|
@ -34,7 +34,7 @@
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="randombox">
|
<widget class="QCheckBox" name="randombox">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p>If the random port option is on then a random port will be used for the server in the range of values specified on the right. Otherwise, the server will always use the same port.</p><p>If, for example, firewall is used then using specifiec port and unblocking it in the firewall is the way to go.</p><p>There is a chance another service may be using the port, if that happens the server will not start.</p></body></html></string>
|
<string><html><head/><body><p>If the random port option is on then a random port in the range of values specified on the right will be used by the server. Otherwise, the server will always use the same port.</p><p>If, for example, firewall is used then using specifiec port and unblocking it in the firewall is the way to go.</p><p>There is a chance another service may be using the port, if that happens the server will not start.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use random port</string>
|
<string>Use random port</string>
|
||||||
|
|
|
@ -181,7 +181,9 @@ QString KDirShareImpl::publishError() const
|
||||||
|
|
||||||
// for reference:
|
// for reference:
|
||||||
// https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
|
// https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
|
||||||
void KDirShareImpl::respond(const QByteArray &url, QByteArray *outdata, ushort *outhttpstatus, KHTTPHeaders *outheaders)
|
void KDirShareImpl::respond(const QByteArray &url, QByteArray *outdata,
|
||||||
|
ushort *outhttpstatus, KHTTPHeaders *outheaders,
|
||||||
|
QString *outfilepath)
|
||||||
{
|
{
|
||||||
// qDebug() << Q_FUNC_INFO << url;
|
// qDebug() << Q_FUNC_INFO << url;
|
||||||
|
|
||||||
|
@ -219,7 +221,7 @@ void KDirShareImpl::respond(const QByteArray &url, QByteArray *outdata, ushort *
|
||||||
const QString filemime = KMimeType::findByPath(pathinfo.filePath())->name();
|
const QString filemime = KMimeType::findByPath(pathinfo.filePath())->name();
|
||||||
*outhttpstatus = 200;
|
*outhttpstatus = 200;
|
||||||
outheaders->insert("Content-Type", QString::fromLatin1("%1; charset=UTF-8").arg(filemime).toAscii());
|
outheaders->insert("Content-Type", QString::fromLatin1("%1; charset=UTF-8").arg(filemime).toAscii());
|
||||||
outdata->append(pathfile.readAll());
|
outfilepath->append(pathinfo.filePath());
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
outdata->append(s_data404);
|
outdata->append(s_data404);
|
||||||
|
|
|
@ -43,7 +43,10 @@ public:
|
||||||
QString publishError() const;
|
QString publishError() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void respond(const QByteArray &url, QByteArray *outdata, ushort *outhttpstatus, KHTTPHeaders *outheaders) final;
|
void respond(
|
||||||
|
const QByteArray &url,
|
||||||
|
QByteArray *outdata, ushort *outhttpstatus, KHTTPHeaders *outheaders, QString *outfilepath
|
||||||
|
) final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_directory;
|
QString m_directory;
|
||||||
|
|
Loading…
Add table
Reference in a new issue