本文整理汇总了C++中KMPrinter::uri方法的典型用法代码示例。如果您正苦于以下问题:C++ KMPrinter::uri方法的具体用法?C++ KMPrinter::uri怎么用?C++ KMPrinter::uri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KMPrinter
的用法示例。
在下文中一共展示了KMPrinter::uri方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: listJobs
bool KMCupsJobManager::listJobs(const QString& prname, KMJobManager::JobType type, int limit)
{
IppRequest req;
QStringList keys;
CupsInfos *infos = CupsInfos::self();
// wanted attributes
keys.append("job-id");
keys.append("job-uri");
keys.append("job-name");
keys.append("job-state");
keys.append("job-printer-uri");
keys.append("job-k-octets");
keys.append("job-originating-user-name");
keys.append("job-k-octets-completed");
keys.append("job-media-sheets");
keys.append("job-media-sheets-completed");
keys.append("job-priority");
keys.append("job-billing");
req.setOperation(IPP_GET_JOBS);
// add printer-uri
KMPrinter *mp = KMManager::self()->findPrinter(prname);
if (!mp)
return false;
if (!mp->uri().isEmpty())
{
req.addURI(IPP_TAG_OPERATION, "printer-uri", mp->uri().prettyURL());
/*
req.setHost(mp->uri().host());
req.setPort(mp->uri().port());
*/
}
else
req.addURI(IPP_TAG_OPERATION, "printer-uri", QString("ipp://%1/%2/%3").arg(infos->hostaddr(),
(mp&&mp->isClass())?"classes":"printers", prname));
// other attributes
req.addKeyword(IPP_TAG_OPERATION, "requested-attributes", keys);
if (type == KMJobManager::CompletedJobs)
req.addKeyword(IPP_TAG_OPERATION,"which-jobs",QString::fromLatin1("completed"));
if (limit > 0)
req.addInteger(IPP_TAG_OPERATION,"limit",limit);
// send request
if (req.doRequest("/"))
parseListAnswer(req, mp);
else
return false;
return true;
}