mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kio: remove code for standalone kioslave
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
78a79cd548
commit
9ff99942ab
3 changed files with 4 additions and 64 deletions
|
@ -28,39 +28,7 @@
|
|||
#include <QtCore/qstringlist.h>
|
||||
#include <QtCore/QTextCodec>
|
||||
|
||||
#ifdef DATAKIOSLAVE
|
||||
# include <kinstance.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if !defined(DATAKIOSLAVE)
|
||||
# define DISPATCH(f) dispatch_##f
|
||||
#else
|
||||
# define DISPATCH(f) f
|
||||
#endif
|
||||
|
||||
using namespace KIO;
|
||||
#ifdef DATAKIOSLAVE
|
||||
extern "C" {
|
||||
|
||||
int kdemain( int argc, char **argv ) {
|
||||
KComponentData componentData( "kio_data" );
|
||||
|
||||
kDebug(7101) << "*** Starting kio_data ";
|
||||
|
||||
if (argc != 4) {
|
||||
kDebug(7101) << "Usage: kio_data protocol domain-socket1 domain-socket2";
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
DataProtocol slave(argv[2], argv[3]);
|
||||
slave.dispatchLoop();
|
||||
|
||||
kDebug(7101) << "*** kio_data Done";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/** structure containing header information */
|
||||
struct DataHeader {
|
||||
|
@ -235,12 +203,7 @@ static DataHeader parseDataHeader(const KUrl &url, const bool mimeOnly)
|
|||
return header_info;
|
||||
}
|
||||
|
||||
#ifdef DATAKIOSLAVE
|
||||
DataProtocol::DataProtocol(const QByteArray &pool_socket, const QByteArray &app_socket)
|
||||
: SlaveBase("kio_data", pool_socket, app_socket) {
|
||||
#else
|
||||
DataProtocol::DataProtocol() {
|
||||
#endif
|
||||
kDebug();
|
||||
}
|
||||
|
||||
|
@ -283,14 +246,7 @@ void DataProtocol::get(const KUrl& url) {
|
|||
totalSize(outData.size());
|
||||
|
||||
//kDebug() << "emit setMetaData@"<<this;
|
||||
#if defined(DATAKIOSLAVE)
|
||||
MetaData::ConstIterator it;
|
||||
for (it = hdr.attributes.constBegin(); it != hdr.attributes.constEnd(); ++it) {
|
||||
setMetaData(it.key(),it.value());
|
||||
}/*next it*/
|
||||
#else
|
||||
setAllMetaData(hdr.attributes);
|
||||
#endif
|
||||
|
||||
//kDebug() << "emit sendMetaData@"<<this;
|
||||
sendMetaData();
|
||||
|
@ -298,9 +254,9 @@ void DataProtocol::get(const KUrl& url) {
|
|||
// empiric studies have shown that this shouldn't be queued & dispatched
|
||||
data(outData);
|
||||
// kDebug() << "(2) queue size " << dispatchQueue.size();
|
||||
DISPATCH(data(QByteArray()));
|
||||
dispatch_data(QByteArray());
|
||||
// kDebug() << "(3) queue size " << dispatchQueue.size();
|
||||
DISPATCH(finished());
|
||||
dispatch_finished();
|
||||
// kDebug() << "(4) queue size " << dispatchQueue.size();
|
||||
deref();
|
||||
}
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
#define DATAPROTOCOL_H
|
||||
|
||||
// dataprotocol.* interprets the following defines
|
||||
// DATAKIOSLAVE: define if you want to compile this into a stand-alone
|
||||
// kioslave
|
||||
// TESTKIO: define for test-driving
|
||||
// Both defines are mutually exclusive. Defining none of them compiles
|
||||
// DataProtocol for internal usage within libkiocore.
|
||||
|
@ -34,18 +32,13 @@
|
|||
* However, given that data-urls don't depend on any external data it seemed
|
||||
* overkill, therefore I added a special hack that the kio-dataslave is invoked
|
||||
* in-process on the client side.
|
||||
*
|
||||
* Hence, by defining DATAKIOSLAVE you can disable this special hack and compile
|
||||
* dataprotocol.* into a standalone kioslave.
|
||||
*/
|
||||
|
||||
class QByteArray;
|
||||
|
||||
class KUrl;
|
||||
|
||||
#if defined(DATAKIOSLAVE)
|
||||
# include <kio/slavebase.h>
|
||||
#elif !defined(TESTKIO)
|
||||
#if !defined(TESTKIO)
|
||||
# include "kio/dataslave.h"
|
||||
#endif
|
||||
|
||||
|
@ -55,20 +48,14 @@ namespace KIO {
|
|||
* @see http://www.ietf.org/rfc/rfc2397.txt
|
||||
* @author Leo Savernik
|
||||
*/
|
||||
#if defined(DATAKIOSLAVE)
|
||||
class DataProtocol : public KIO::SlaveBase {
|
||||
#elif defined(TESTKIO)
|
||||
#if defined(TESTKIO)
|
||||
class DataProtocol : public TestSlave {
|
||||
#else
|
||||
class DataProtocol : public DataSlave {
|
||||
#endif
|
||||
|
||||
public:
|
||||
#if defined(DATAKIOSLAVE)
|
||||
DataProtocol(const QByteArray &pool_socket, const QByteArray &app_socket);
|
||||
#else
|
||||
DataProtocol();
|
||||
#endif
|
||||
virtual ~DataProtocol();
|
||||
virtual void mimetype(const KUrl &url);
|
||||
virtual void get(const KUrl &url);
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
* Copyright (C) 2012 Rolf Eike Beer <kde@opensource.sf-tec.de>
|
||||
*/
|
||||
|
||||
#ifdef DATAKIOSLAVE
|
||||
# undef DATAKIOSLAVE
|
||||
#endif
|
||||
#ifndef TESTKIO
|
||||
# define TESTKIO
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue