本文整理汇总了C++中ItemFetchJob::errorString方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemFetchJob::errorString方法的具体用法?C++ ItemFetchJob::errorString怎么用?C++ ItemFetchJob::errorString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemFetchJob
的用法示例。
在下文中一共展示了ItemFetchJob::errorString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stat
void AkonadiSlave::stat(const QUrl &url)
{
qCDebug(AKONADISLAVE_LOG) << url;
// Stats for a collection
if (Collection::fromUrl(url).isValid()) {
Collection collection = Collection::fromUrl(url);
if (collection != Collection::root()) {
// Check that the collection exists.
CollectionFetchJob *job = new CollectionFetchJob(collection, CollectionFetchJob::Base);
if (!job->exec()) {
error(KIO::ERR_INTERNAL, job->errorString());
return;
}
if (job->collections().count() != 1) {
error(KIO::ERR_DOES_NOT_EXIST, i18n("No such item."));
return;
}
collection = job->collections().at(0);
}
statEntry(entryForCollection(collection));
finished();
}
// Stats for an item
else if (Item::fromUrl(url).isValid()) {
ItemFetchJob *job = new ItemFetchJob(Item::fromUrl(url));
if (!job->exec()) {
error(KIO::ERR_INTERNAL, job->errorString());
return;
}
if (job->items().count() != 1) {
error(KIO::ERR_DOES_NOT_EXIST, i18n("No such item."));
return;
}
const Item item = job->items().at(0);
statEntry(entryForItem(item));
finished();
}
}
示例2: get
void AkonadiSlave::get(const QUrl &url)
{
const Item item = Item::fromUrl(url);
ItemFetchJob *job = new ItemFetchJob(item);
job->fetchScope().fetchFullPayload();
if (!job->exec()) {
error(KIO::ERR_INTERNAL, job->errorString());
return;
}
if (job->items().count() != 1) {
error(KIO::ERR_DOES_NOT_EXIST, i18n("No such item."));
} else {
const Item item = job->items().at(0);
QByteArray tmp = item.payloadData();
data(tmp);
data(QByteArray());
finished();
}
finished();
}