本文整理汇总了C++中CalendarItem::updateWithICSData方法的典型用法代码示例。如果您正苦于以下问题:C++ CalendarItem::updateWithICSData方法的具体用法?C++ CalendarItem::updateWithICSData怎么用?C++ CalendarItem::updateWithICSData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CalendarItem
的用法示例。
在下文中一共展示了CalendarItem::updateWithICSData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotReplyFinished
void OwnCloudService::slotReplyFinished(QNetworkReply *reply) {
qDebug() << "Reply from " << reply->url().path();
// qDebug() << reply->errorString();
// this should only be called from the settings dialog
if (reply->url().path().endsWith(appInfoPath)) {
qDebug() << "Reply from app info";
// check if everything is all right and call the callback method
checkAppInfo(reply);
return;
} else {
QByteArray arr = reply->readAll();
QString data = QString(arr);
if (reply->url().path().endsWith(versionListPath)) {
qDebug() << "Reply from version list";
// qDebug() << data;
// handle the versions loading
handleVersionsLoading(data);
return;
} else if (reply->url().path().endsWith(trashListPath)) {
qDebug() << "Reply from trash list";
// qDebug() << data;
// handle the loading of trashed notes
handleTrashedLoading(data);
return;
} else if (reply->url().path().endsWith(capabilitiesPath)) {
qDebug() << "Reply from capabilities page";
if (data.startsWith("<?xml version=")) {
settingsDialog->setOKLabelData(3, "ok", SettingsDialog::OK);
} else {
settingsDialog->setOKLabelData(3, "not correct",
SettingsDialog::Failure);
}
return;
} else if (reply->url().path().endsWith(ownCloudTestPath)) {
qDebug() << "Reply from ownCloud test page";
if (data.startsWith("<?xml version=")) {
settingsDialog->setOKLabelData(2, "ok", SettingsDialog::OK);
} else {
settingsDialog->setOKLabelData(2, "not detected",
SettingsDialog::Failure);
}
return;
} else if (reply->url().path().endsWith(restoreTrashedNotePath)) {
qDebug() << "Reply from ownCloud restore trashed note page";
// qDebug() << data;
return;
} else if (reply->url().path().endsWith(serverUrlPath + calendarPath)) {
qDebug() << "Reply from ownCloud calendar page";
// qDebug() << data;
QStringList calendarHrefList = parseCalendarHrefList(data);
settingsDialog->refreshTodoCalendarList(calendarHrefList);
return;
} else if (reply->url().path()
.startsWith(serverUrlPath + calendarPath)) {
// check if we have a reply from a calendar item request
if (reply->url().path().endsWith(".ics")) {
qDebug() << "Reply from ownCloud calendar item ics page";
// qDebug() << data;
// a workaround for a ownCloud error message
if (data.indexOf(
"<s:message>Unable to generate a URL for the named"
" route \"tasksplus.page.index\" as such route"
" does not exist.</s:message>") >
20) {
data = "";
}
// this will mostly happen after the PUT request to update
// or create a todo item
if (data == "") {
// reload the todo list from server
this->todoDialog->reloadTodoList();
}
// increment the progress bar
this->todoDialog->todoItemLoadingProgressBarIncrement();
// fetch the calendar item, that was already stored
// by loadTodoItems()
CalendarItem calItem = CalendarItem::fetchByUrlAndCalendar(
reply->url().toString(), calendarName);
if (calItem.isFetched()) {
// update the item with the ics data
bool wasUpdated = calItem.updateWithICSData(data);
// if item wasn't updated (for example because it was no
//.........这里部分代码省略.........