本文整理汇总了C++中kio::StoredTransferJob::setMetaData方法的典型用法代码示例。如果您正苦于以下问题:C++ StoredTransferJob::setMetaData方法的具体用法?C++ StoredTransferJob::setMetaData怎么用?C++ StoredTransferJob::setMetaData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kio::StoredTransferJob
的用法示例。
在下文中一共展示了StoredTransferJob::setMetaData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doAnnounce
void HTTPTracker::doAnnounce(const KURL & u)
{
Out(SYS_TRK|LOG_NOTICE) << "Doing tracker request to url : " << u.prettyURL() << endl;
KIO::MetaData md;
setupMetaData(md);
KIO::StoredTransferJob* j = KIO::storedGet(u,false,false);
// set the meta data
j->setMetaData(md);
KIO::Scheduler::scheduleJob(j);
connect(j,SIGNAL(result(KIO::Job* )),this,SLOT(onAnnounceResult( KIO::Job* )));
active_job = j;
requestPending();
}
示例2: scrape
void HTTPTracker::scrape()
{
if (!url.isValid())
{
Out(SYS_TRK|LOG_NOTICE) << "Invalid tracker url, canceling scrape" << endl;
return;
}
if (!url.fileName(false).startsWith("announce"))
{
Out(SYS_TRK|LOG_NOTICE) << "Tracker " << url << " does not support scraping" << endl;
return;
}
KURL scrape_url = url;
scrape_url.setFileName(url.fileName(false).replace("announce","scrape"));
QString epq = scrape_url.encodedPathAndQuery();
const SHA1Hash & info_hash = tor->getInfoHash();
if (scrape_url.queryItems().count() > 0)
epq += "&info_hash=" + info_hash.toURLString();
else
epq += "?info_hash=" + info_hash.toURLString();
scrape_url.setEncodedPathAndQuery(epq);
Out(SYS_TRK|LOG_NOTICE) << "Doing scrape request to url : " << scrape_url.prettyURL() << endl;
KIO::MetaData md;
setupMetaData(md);
KIO::StoredTransferJob* j = KIO::storedGet(scrape_url,false,false);
// set the meta data
j->setMetaData(md);
KIO::Scheduler::scheduleJob(j);
connect(j,SIGNAL(result(KIO::Job* )),this,SLOT(onScrapeResult( KIO::Job* )));
}