Hi,

This time I am in trouble experimenting with KIO::ForwardingSlaveBase

Here is the code:

class SKioSlave : public KIO::ForwardingSlaveBase{
public:
    SKioSlave(const QByteArray& poolSocket, const QByteArray& appSocket);
    virtual ~SKioSlave();
    virtual bool rewriteUrl(const KUrl& url, KUrl& newURL);
};

extern "C" int KDE_EXPORT kdemain( int argc, char **argv ){
    KComponentData instance( "kio_sparkle" );

    if (argc != 4){
        fprintf( stderr, "Usage: kio_sparkle protocol domain-socket1
domain-socket2\n");
        exit( -1 );
    }
    SKioSlave slave( argv[2], argv[3] );
    slave.dispatchLoop();
    return 0;
}

SKioSlave::SKioSlave(const QByteArray& poolSocket, const QByteArray&
appSocket): ForwardingSlaveBase("sparkle", poolSocket, appSocket){
}

SKioSlave::~SKioSlave(){
}

bool SKioSlave::rewriteUrl(const KUrl& url, KUrl& newURL){
    newURL.setProtocol("file");
    newURL.addPath("/");//Just in case we dont get '/' for root
    return true;
}

Here is the protocol file:

[Protocol]
exec=kio_sparkle
protocol=sparkle
Icon=user-desktop
input=none
output=filesystem
listing=Name,Type,Size,Date,AccessDate,Access,Owner,Group,Link
reading=true
writing=true
makedir=true
deleting=true
linking=true
moving=true
opening=true
maxInstances=4
Class=:local


Here is the outpur of 'kioclient exec sparkle:/'
kioclient(20314)/kio (KRun): KRun(0x78fc80) ERROR 143 "The process for
the sparkle protocol died unexpectedly."

Monitoring with debug messages (above code is striped of them) show
that rewriteUrl() is being called and it is ok till return.

Please shed some light on this. I'm getting crazy ;-)

Regards,

Yogesh Marwaha

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to