Пример #1
0
void HtmlExport::createEvent(QTextStream *ts,
                             const Event::Ptr &event,
                             QDate date,
                             bool withDescription)
{
    qCDebug(KCALUTILS_LOG) << event->summary();
    *ts << "  <tr>" << endl;

    if (!event->allDay()) {
        if (event->isMultiDay(d->mCalendar->timeSpec()) && (event->dtStart().date() != date)) {
            *ts << "    <td>&nbsp;</td>" << endl;
        } else {
            *ts << "    <td valign=\"top\">"
                << Stringify::formatTime(event->dtStart(), true, d->mCalendar->timeSpec())
                << "</td>" << endl;
        }
        if (event->isMultiDay(d->mCalendar->timeSpec()) && (event->dtEnd().date() != date)) {
            *ts << "    <td>&nbsp;</td>" << endl;
        } else {
            *ts << "    <td valign=\"top\">"
                << Stringify::formatTime(event->dtEnd(), true, d->mCalendar->timeSpec())
                << "</td>" << endl;
        }
    } else {
        *ts << "    <td>&nbsp;</td><td>&nbsp;</td>" << endl;
    }

    *ts << "    <td class=\"sum\">" << endl;
    *ts << "      <b>" << cleanChars(event->summary()) << "</b>" << endl;
    if (withDescription && !event->description().isEmpty()) {
        *ts << "      <p>" << breakString(cleanChars(event->description())) << "</p>" << endl;
    }
    *ts << "    </td>" << endl;

    if (d->mSettings->eventLocation()) {
        *ts << "  <td>" << endl;
        formatLocation(ts, event);
        *ts << "  </td>" << endl;
    }

    if (d->mSettings->eventCategories()) {
        *ts << "  <td>" << endl;
        formatCategories(ts, event);
        *ts << "  </td>" << endl;
    }

    if (d->mSettings->eventAttendees()) {
        *ts << "  <td>" << endl;
        formatAttendees(ts, event);
        *ts << "  </td>" << endl;
    }

    *ts << "  </tr>" << endl;
}
Пример #2
0
void KonsoleKalendarDelete::printSpecs(const Event::Ptr &event)
{
    cout << i18n("  UID:   %1",  m_variables->getUID()).data()
         << endl;

    cout << i18n("  What:  %1", event->summary()).data()
         << endl;

    KDateTime::Spec timeSpec = m_variables->getCalendar()->timeSpec();
    cout << i18n("  Begin: %1",
                 event->dtStart().toTimeSpec(timeSpec).dateTime().toString(Qt::TextDate)).data()
         << endl;

    cout << i18n("  End:   %1",
                 event->dtEnd().toTimeSpec(timeSpec).dateTime().toString(Qt::TextDate)).data()
         << endl;

    cout << i18n("  Desc:  %1",
                 event->description()).data()
         << endl;

    cout << i18n("  Location:  %1",
                 event->location()).data()
         << endl;
}