本文整理汇总了C++中KUrl::encodedPathAndQuery方法的典型用法代码示例。如果您正苦于以下问题:C++ KUrl::encodedPathAndQuery方法的具体用法?C++ KUrl::encodedPathAndQuery怎么用?C++ KUrl::encodedPathAndQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KUrl
的用法示例。
在下文中一共展示了KUrl::encodedPathAndQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doRequest
void HTTPTracker::doRequest(WaitJob* wjob)
{
KUrl u = url;
if (!url.isValid())
{
requestPending();
QTimer::singleShot(500, this, SLOT(emitInvalidURLFailure()));
return;
}
Uint16 port = ServerInterface::getPort();
u.addQueryItem("peer_id", peer_id.toString());
u.addQueryItem("port", QString::number(port));
u.addQueryItem("uploaded", QString::number(bytesUploaded()));
u.addQueryItem("downloaded", QString::number(bytesDownloaded()));
if (event == "completed")
u.addQueryItem("left", "0"); // need to send 0 when we are completed
else
u.addQueryItem("left", QString::number(tds->bytesLeft()));
u.addQueryItem("compact", "1");
if (event != "stopped")
u.addQueryItem("numwant", "200");
else
u.addQueryItem("numwant", "0");
u.addQueryItem("key", QString::number(key));
QString cip = Tracker::getCustomIP();
if (cip.isNull())
cip = CurrentIPv6Address();
if (!cip.isEmpty())
u.addQueryItem("ip", cip);
if (event.isEmpty() && supports_partial_seed_extension && tds->isPartialSeed())
event = "paused";
if (!event.isEmpty())
u.addQueryItem("event", event);
QString epq = u.encodedPathAndQuery();
const SHA1Hash & info_hash = tds->infoHash();
epq += "&info_hash=" + info_hash.toURLString();
u.setEncodedPathAndQuery(epq);
if (active_job)
{
announce_queue.append(u);
Out(SYS_TRK | LOG_NOTICE) << "Announce ongoing, queueing announce" << endl;
}
else
{
doAnnounce(u);
// if there is a wait job, add this job to the waitjob
if (wjob)
wjob->addExitOperation(new ExitJobOperation(active_job));
}
}