-rw-r--r-- | libkcal/incidencebase.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 7525a4a..51f2e9d 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp | |||
@@ -118,128 +118,129 @@ bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 ) | |||
118 | } | 118 | } |
119 | 119 | ||
120 | 120 | ||
121 | QDateTime IncidenceBase::getEvenTime( QDateTime dt ) | 121 | QDateTime IncidenceBase::getEvenTime( QDateTime dt ) |
122 | { | 122 | { |
123 | QTime t = dt.time(); | 123 | QTime t = dt.time(); |
124 | dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); | 124 | dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); |
125 | return dt; | 125 | return dt; |
126 | } | 126 | } |
127 | 127 | ||
128 | 128 | ||
129 | void IncidenceBase::setUid(const QString &uid) | 129 | void IncidenceBase::setUid(const QString &uid) |
130 | { | 130 | { |
131 | mUid = uid; | 131 | mUid = uid; |
132 | updated(); | 132 | updated(); |
133 | } | 133 | } |
134 | 134 | ||
135 | QString IncidenceBase::uid() const | 135 | QString IncidenceBase::uid() const |
136 | { | 136 | { |
137 | return mUid; | 137 | return mUid; |
138 | } | 138 | } |
139 | 139 | ||
140 | void IncidenceBase::setLastModified(const QDateTime &lm) | 140 | void IncidenceBase::setLastModified(const QDateTime &lm) |
141 | { | 141 | { |
142 | // DON'T! updated() because we call this from | 142 | // DON'T! updated() because we call this from |
143 | // Calendar::updateEvent(). | 143 | // Calendar::updateEvent(). |
144 | mLastModified = getEvenTime(lm); | 144 | mLastModified = getEvenTime(lm); |
145 | //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); | 145 | //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); |
146 | } | 146 | } |
147 | 147 | ||
148 | QDateTime IncidenceBase::lastModified() const | 148 | QDateTime IncidenceBase::lastModified() const |
149 | { | 149 | { |
150 | return mLastModified; | 150 | return mLastModified; |
151 | } | 151 | } |
152 | 152 | ||
153 | void IncidenceBase::setOrganizer(const QString &o) | 153 | void IncidenceBase::setOrganizer(const QString &o) |
154 | { | 154 | { |
155 | // we don't check for readonly here, because it is | 155 | // we don't check for readonly here, because it is |
156 | // possible that by setting the organizer we are changing | 156 | // possible that by setting the organizer we are changing |
157 | // the event's readonly status... | 157 | // the event's readonly status... |
158 | mOrganizer = o; | 158 | mOrganizer = o; |
159 | if (mOrganizer.left(7).upper() == "MAILTO:") | 159 | if (mOrganizer.left(7).upper() == "MAILTO:") |
160 | mOrganizer = mOrganizer.remove(0,7); | 160 | mOrganizer = mOrganizer.remove(0,7); |
161 | 161 | ||
162 | updated(); | 162 | updated(); |
163 | } | 163 | } |
164 | 164 | ||
165 | QString IncidenceBase::organizer() const | 165 | QString IncidenceBase::organizer() const |
166 | { | 166 | { |
167 | return mOrganizer; | 167 | return mOrganizer; |
168 | } | 168 | } |
169 | 169 | ||
170 | void IncidenceBase::setReadOnly( bool readOnly ) | 170 | void IncidenceBase::setReadOnly( bool readOnly ) |
171 | { | 171 | { |
172 | mReadOnly = readOnly; | 172 | mReadOnly = readOnly; |
173 | } | 173 | } |
174 | 174 | ||
175 | void IncidenceBase::setDtStart(const QDateTime &dtStart) | 175 | void IncidenceBase::setDtStart(const QDateTime &dtStart) |
176 | { | 176 | { |
177 | // if (mReadOnly) return; | 177 | // if (mReadOnly) return; |
178 | mDtStart = getEvenTime(dtStart); | 178 | mDtStart = getEvenTime(dtStart); |
179 | updated(); | 179 | updated(); |
180 | } | 180 | } |
181 | 181 | ||
182 | |||
182 | QDateTime IncidenceBase::dtStart() const | 183 | QDateTime IncidenceBase::dtStart() const |
183 | { | 184 | { |
184 | return mDtStart; | 185 | return mDtStart; |
185 | } | 186 | } |
186 | 187 | ||
187 | QString IncidenceBase::dtStartTimeStr() const | 188 | QString IncidenceBase::dtStartTimeStr() const |
188 | { | 189 | { |
189 | return KGlobal::locale()->formatTime(dtStart().time()); | 190 | return KGlobal::locale()->formatTime(dtStart().time()); |
190 | } | 191 | } |
191 | 192 | ||
192 | QString IncidenceBase::dtStartDateStr(bool shortfmt) const | 193 | QString IncidenceBase::dtStartDateStr(bool shortfmt) const |
193 | { | 194 | { |
194 | return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); | 195 | return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); |
195 | } | 196 | } |
196 | 197 | ||
197 | QString IncidenceBase::dtStartStr(bool shortfmt) const | 198 | QString IncidenceBase::dtStartStr(bool shortfmt) const |
198 | { | 199 | { |
199 | return KGlobal::locale()->formatDateTime(dtStart(), shortfmt); | 200 | return KGlobal::locale()->formatDateTime(dtStart(), shortfmt); |
200 | } | 201 | } |
201 | 202 | ||
202 | 203 | ||
203 | bool IncidenceBase::doesFloat() const | 204 | bool IncidenceBase::doesFloat() const |
204 | { | 205 | { |
205 | return mFloats; | 206 | return mFloats; |
206 | } | 207 | } |
207 | 208 | ||
208 | void IncidenceBase::setFloats(bool f) | 209 | void IncidenceBase::setFloats(bool f) |
209 | { | 210 | { |
210 | if (mReadOnly) return; | 211 | if (mReadOnly) return; |
211 | mFloats = f; | 212 | mFloats = f; |
212 | updated(); | 213 | updated(); |
213 | } | 214 | } |
214 | 215 | ||
215 | 216 | ||
216 | bool IncidenceBase::addAttendee(Attendee *a, bool doupdate) | 217 | bool IncidenceBase::addAttendee(Attendee *a, bool doupdate) |
217 | { | 218 | { |
218 | if (mReadOnly) return false; | 219 | if (mReadOnly) return false; |
219 | if (a->name().left(7).upper() == "MAILTO:") | 220 | if (a->name().left(7).upper() == "MAILTO:") |
220 | a->setName(a->name().remove(0,7)); | 221 | a->setName(a->name().remove(0,7)); |
221 | 222 | ||
222 | QPtrListIterator<Attendee> qli(mAttendees); | 223 | QPtrListIterator<Attendee> qli(mAttendees); |
223 | 224 | ||
224 | qli.toFirst(); | 225 | qli.toFirst(); |
225 | while (qli) { | 226 | while (qli) { |
226 | if (*qli.current() == *a) | 227 | if (*qli.current() == *a) |
227 | return false; | 228 | return false; |
228 | ++qli; | 229 | ++qli; |
229 | } | 230 | } |
230 | mAttendees.append(a); | 231 | mAttendees.append(a); |
231 | if (doupdate) updated(); | 232 | if (doupdate) updated(); |
232 | return true; | 233 | return true; |
233 | } | 234 | } |
234 | 235 | ||
235 | #if 0 | 236 | #if 0 |
236 | void IncidenceBase::removeAttendee(Attendee *a) | 237 | void IncidenceBase::removeAttendee(Attendee *a) |
237 | { | 238 | { |
238 | if (mReadOnly) return; | 239 | if (mReadOnly) return; |
239 | mAttendees.removeRef(a); | 240 | mAttendees.removeRef(a); |
240 | updated(); | 241 | updated(); |
241 | } | 242 | } |
242 | 243 | ||
243 | void IncidenceBase::removeAttendee(const char *n) | 244 | void IncidenceBase::removeAttendee(const char *n) |
244 | { | 245 | { |
245 | Attendee *a; | 246 | Attendee *a; |