Changeset View
Changeset View
Standalone View
Standalone View
src/printing/journalprint.cpp
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | 99 | if (cfg) { | |||
---|---|---|---|---|---|
100 | cfg->mFromDate->setDate(from); | 100 | cfg->mFromDate->setDate(from); | ||
101 | cfg->mToDate->setDate(to); | 101 | cfg->mToDate->setDate(to); | ||
102 | } | 102 | } | ||
103 | } | 103 | } | ||
104 | 104 | | |||
105 | void CalPrintJournal::print(QPainter &p, int width, int height) | 105 | void CalPrintJournal::print(QPainter &p, int width, int height) | ||
106 | { | 106 | { | ||
107 | int x = 0, y = 0; | 107 | int x = 0, y = 0; | ||
108 | KCalCore::Journal::List journals(mCalendar->journals()); | 108 | KCalendarCore::Journal::List journals(mCalendar->journals()); | ||
109 | if (mUseDateRange) { | 109 | if (mUseDateRange) { | ||
110 | const KCalCore::Journal::List allJournals = journals; | 110 | const KCalendarCore::Journal::List allJournals = journals; | ||
111 | journals.clear(); | 111 | journals.clear(); | ||
112 | for (const KCalCore::Journal::Ptr &j : allJournals) { | 112 | for (const KCalendarCore::Journal::Ptr &j : allJournals) { | ||
113 | const QDate dt = j->dtStart().date(); | 113 | const QDate dt = j->dtStart().date(); | ||
114 | if (mFromDate <= dt && dt <= mToDate) { | 114 | if (mFromDate <= dt && dt <= mToDate) { | ||
115 | journals.append(j); | 115 | journals.append(j); | ||
116 | } | 116 | } | ||
117 | } | 117 | } | ||
118 | } | 118 | } | ||
119 | 119 | | |||
120 | QRect headerBox(0, 0, width, headerHeight()); | 120 | QRect headerBox(0, 0, width, headerHeight()); | ||
121 | QRect footerBox(0, height - footerHeight(), width, footerHeight()); | 121 | QRect footerBox(0, height - footerHeight(), width, footerHeight()); | ||
122 | height -= footerHeight(); | 122 | height -= footerHeight(); | ||
123 | 123 | | |||
124 | drawHeader(p, i18n("Journal entries"), QDate(), QDate(), headerBox); | 124 | drawHeader(p, i18n("Journal entries"), QDate(), QDate(), headerBox); | ||
125 | y = headerHeight() + 15; | 125 | y = headerHeight() + 15; | ||
126 | 126 | | |||
127 | for (const KCalCore::Journal::Ptr &j : qAsConst(journals)) { | 127 | for (const KCalendarCore::Journal::Ptr &j : qAsConst(journals)) { | ||
128 | drawJournal(j, p, x, y, width, height); | 128 | drawJournal(j, p, x, y, width, height); | ||
129 | } | 129 | } | ||
130 | 130 | | |||
131 | drawFooter(p, footerBox); | 131 | drawFooter(p, footerBox); | ||
132 | } | 132 | } |