Bug#23129: TransferJob dataReq

Stephan Kulow coolo at kde.org
Tue Mar 27 12:56:14 UTC 2001


peter.buckenleib at debitel.net wrote:
> 
> Package: kdevelop
> Version: KDE 2.1.0
> Severity: normal
> Installed from:    SuSE RPMs
> Compiler:          gcc 2.95.2
> OS:                Linux
> OS/Compiler notes: SuSE 7.1
> 
> that's first of all a documentation problem. The "documention" for TransferJob(KIO) is not very usefull at all.
> 
> I'll want to read data from a website and tried to use this code:
> 
>     KURL *From = new KURL(Adr);
>         KIO::TransferJob * TJ = new KIO::TransferJob(*From, 0, 0, 0, true);
>         KIO::Slave * ioslave = TJ->slave();
>         TJ->start(ioslave);
>         connect(TJ,SIGNAL(data(KIO::Job * , const QByteArray &) ),
>                         this,SLOT(slotdata(KIO::Job *, const QByteArray &) ));
>         connect(TJ,SIGNAL(dataReq(KIO::Job * , const QByteArray &) ),
>                         this,SLOT(slotdataReq(KIO::Job *, const QByteArray &) ));
>         connect(TJ,SIGNAL(KIO::mimetype( KIO::Job *, const QString type ) ),
>                         this,SLOT(slotmimetype( KIO::Job *, const QString  ) ));
>         connect(TJ,SIGNAL(KIO::slotError ( int , const QString & ) ),
>                         this,SLOT(slotError ( int , const QString & ) ));
> 
> It compiles without any errors. But when i run this code i get the following error-messages (and a program-crash of course):
> 
> QObject::connect: Cannot connect (null)::data( const QByteArray & ) to KIO::TransferJob::slotData( const QByteArray & )
> QObject::connect: Cannot connect (null)::dataReq() to KIO::TransferJob::slotDataReq()
> QObject::connect: Cannot connect (null)::redirection(const KURL &) to KIO::TransferJob::slotRedirection(const KURL &)
> QObject::connect: Cannot connect (null)::mimeType( const QString& ) to KIO::TransferJob::slotMimetype( const QString& )
> QObject::connect: Cannot connect (null)::metaData( const KIO::MetaData& ) to KIO::TransferJob::slotMetaData( const KIO::MetaData& )
> QObject::connect: Cannot connect (null)::errorPage() to KIO::TransferJob::slotErrorPage()
> QObject::connect: Cannot connect (null)::needSubURLData() to KIO::TransferJob::slotNeedSubURLData()
> QObject::connect: Cannot connect (null)::canResume( unsigned long ) to KIO::TransferJob::slotCanResume( unsigned long )
> 
> So what's going on here?
> Are there any docs describing how KIO works?
> Are there any examples how to read data from a website?
You don't create jobs with new, but with the functions in jobs.h. Like download and it's
started on it's own.

Greetings, Stephan

-- 
Teigwaren heissen Teigwaren, weil sie Teig waren * J. v. d. Lippe
MFCH

-
to unsubscribe from this list send an email to kdevelop-devel-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop-devel mailing list