Changeset View
Changeset View
Standalone View
Standalone View
src/whatsnext/whatsnextview.cpp
Show First 20 Lines • Show All 186 Lines • ▼ Show 20 Line(s) | 159 | if (!todos.isEmpty()) { | |||
---|---|---|---|---|---|
187 | } | 187 | } | ||
188 | } | 188 | } | ||
189 | 189 | | |||
190 | QStringList myEmails(CalendarSupport::KCalPrefs::instance()->allEmails()); | 190 | QStringList myEmails(CalendarSupport::KCalPrefs::instance()->allEmails()); | ||
191 | int replies = 0; | 191 | int replies = 0; | ||
192 | events = calendar()->events(QDate::currentDate(), QDate(2975, 12, 6), | 192 | events = calendar()->events(QDate::currentDate(), QDate(2975, 12, 6), | ||
193 | QTimeZone::systemTimeZone()); | 193 | QTimeZone::systemTimeZone()); | ||
194 | for (const KCalCore::Event::Ptr &ev : qAsConst(events)) { | 194 | for (const KCalCore::Event::Ptr &ev : qAsConst(events)) { | ||
195 | KCalCore::Attendee::Ptr me = ev->attendeeByMails(myEmails); | 195 | KCalCore::Attendee me = ev->attendeeByMails(myEmails); | ||
196 | if (me != nullptr) { | 196 | if (!me.isNull()) { | ||
197 | if (me->status() == KCalCore::Attendee::NeedsAction && me->RSVP()) { | 197 | if (me.status() == KCalCore::Attendee::NeedsAction && me.RSVP()) { | ||
198 | if (replies == 0) { | 198 | if (replies == 0) { | ||
199 | mText += QLatin1String("<p></p>"); | 199 | mText += QLatin1String("<p></p>"); | ||
200 | kil->loadIcon(QStringLiteral("mail-reply-sender"), KIconLoader::NoGroup, 22, | 200 | kil->loadIcon(QStringLiteral("mail-reply-sender"), KIconLoader::NoGroup, 22, | ||
201 | KIconLoader::DefaultState, QStringList(), &ipath); | 201 | KIconLoader::DefaultState, QStringList(), &ipath); | ||
202 | mText += QLatin1String("<h2><img src=\""); | 202 | mText += QLatin1String("<h2><img src=\""); | ||
203 | mText += ipath; | 203 | mText += ipath; | ||
204 | mText += QLatin1String("\" width=\"22\" height=\"22\">"); | 204 | mText += QLatin1String("\" width=\"22\" height=\"22\">"); | ||
205 | mText += i18n("Events and to-dos that need a reply:") | 205 | mText += i18n("Events and to-dos that need a reply:") | ||
206 | + QLatin1String("</h2>\n"); | 206 | + QLatin1String("</h2>\n"); | ||
207 | mText += QLatin1String("<table>\n"); | 207 | mText += QLatin1String("<table>\n"); | ||
208 | } | 208 | } | ||
209 | replies++; | 209 | replies++; | ||
210 | appendEvent(ev); | 210 | appendEvent(ev); | ||
211 | } | 211 | } | ||
212 | } | 212 | } | ||
213 | } | 213 | } | ||
214 | todos = calendar()->todos(); | 214 | todos = calendar()->todos(); | ||
215 | for (const KCalCore::Todo::Ptr &to : qAsConst(todos)) { | 215 | for (const KCalCore::Todo::Ptr &to : qAsConst(todos)) { | ||
216 | KCalCore::Attendee::Ptr me = to->attendeeByMails(myEmails); | 216 | KCalCore::Attendee me = to->attendeeByMails(myEmails); | ||
217 | if (me != nullptr) { | 217 | if (!me.isNull()) { | ||
218 | if (me->status() == KCalCore::Attendee::NeedsAction && me->RSVP()) { | 218 | if (me.status() == KCalCore::Attendee::NeedsAction && me.RSVP()) { | ||
219 | if (replies == 0) { | 219 | if (replies == 0) { | ||
220 | mText += QLatin1String("<p></p>"); | 220 | mText += QLatin1String("<p></p>"); | ||
221 | kil->loadIcon(QStringLiteral("mail-reply-sender"), KIconLoader::NoGroup, 22, | 221 | kil->loadIcon(QStringLiteral("mail-reply-sender"), KIconLoader::NoGroup, 22, | ||
222 | KIconLoader::DefaultState, QStringList(), &ipath); | 222 | KIconLoader::DefaultState, QStringList(), &ipath); | ||
223 | mText += QLatin1String("<h2><img src=\""); | 223 | mText += QLatin1String("<h2><img src=\""); | ||
224 | mText += ipath; | 224 | mText += ipath; | ||
225 | mText += QLatin1String("\" width=\"22\" height=\"22\">"); | 225 | mText += QLatin1String("\" width=\"22\" height=\"22\">"); | ||
226 | mText += i18n("Events and to-dos that need a reply:") | 226 | mText += i18n("Events and to-dos that need a reply:") | ||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |