Example #1
0
 void _k_contentTypeCheckFailed(KJob* job)
 {
     KIO::TransferJob* tJob = qobject_cast<KIO::TransferJob*>(job);
     // On error simply call downloadResource which will probably fail as well.
     if (tJob && tJob->error()) {
         (void)downloadResource(tJob->url(), QString(), window, tJob->metaData());
     }
 }
Example #2
0
 void _k_receivedContentType(KIO::Job* job, const QString& mimetype)
 {
     KIO::TransferJob* tJob = qobject_cast<KIO::TransferJob*>(job);
     if (tJob && !tJob->error()) {
         tJob->putOnHold();
         KIO::Scheduler::publishSlaveOnHold();
         // Get suggested file name...
         mimeType = mimetype;
         const QString suggestedFileName (tJob->queryMetaData(QL1S("content-disposition-filename")));
         // kDebug(800) << "suggested filename:" << suggestedFileName << ", mimetype:" << mimetype;
         (void) downloadResource(tJob->url(), suggestedFileName, window, tJob->metaData());
     }
 }