-rw-r--r-- | libkcal/alarm.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index 3157214..3c4a81c 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp | |||
@@ -1,60 +1,62 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | Copyright (c) 1998 Preston Brown | 3 | Copyright (c) 1998 Preston Brown |
4 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public | 7 | modify it under the terms of the GNU Library General Public |
8 | License as published by the Free Software Foundation; either | 8 | License as published by the Free Software Foundation; either |
9 | version 2 of the License, or (at your option) any later version. | 9 | version 2 of the License, or (at your option) any later version. |
10 | 10 | ||
11 | This library is distributed in the hope that it will be useful, | 11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. | 14 | Library General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU Library General Public License | 16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. | 19 | Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <kdebug.h> | 22 | #include <kdebug.h> |
23 | #include <klocale.h> | 23 | #include <klocale.h> |
24 | 24 | ||
25 | #include "incidence.h" | 25 | #include "incidence.h" |
26 | #include "todo.h" | 26 | #include "todo.h" |
27 | 27 | ||
28 | #include "alarm.h" | 28 | #include "alarm.h" |
29 | //Added by qt3to4: | ||
30 | #include <Q3ValueList> | ||
29 | 31 | ||
30 | using namespace KCal; | 32 | using namespace KCal; |
31 | #include <qwidget.h> | 33 | #include <qwidget.h> |
32 | Alarm::Alarm(Incidence *parent) | 34 | Alarm::Alarm(Incidence *parent) |
33 | : mParent(parent), | 35 | : mParent(parent), |
34 | mType(Audio), | 36 | mType(Audio), |
35 | mDescription(""), // to make operator==() not fail | 37 | mDescription(""), // to make operator==() not fail |
36 | mFile(""), // to make operator==() not fail | 38 | mFile(""), // to make operator==() not fail |
37 | mMailSubject(""), // to make operator==() not fail | 39 | mMailSubject(""), // to make operator==() not fail |
38 | mAlarmSnoozeTime(5), | 40 | mAlarmSnoozeTime(5), |
39 | mAlarmRepeatCount(0), | 41 | mAlarmRepeatCount(0), |
40 | mEndOffset(false), | 42 | mEndOffset(false), |
41 | mHasTime(false), | 43 | mHasTime(false), |
42 | mAlarmEnabled(false) | 44 | mAlarmEnabled(false) |
43 | { | 45 | { |
44 | 46 | ||
45 | } | 47 | } |
46 | 48 | ||
47 | Alarm::~Alarm() | 49 | Alarm::~Alarm() |
48 | { | 50 | { |
49 | } | 51 | } |
50 | 52 | ||
51 | bool Alarm::operator==( const Alarm& rhs ) const | 53 | bool Alarm::operator==( const Alarm& rhs ) const |
52 | { | 54 | { |
53 | 55 | ||
54 | if ( mType != rhs.mType || | 56 | if ( mType != rhs.mType || |
55 | mAlarmSnoozeTime != rhs.mAlarmSnoozeTime || | 57 | mAlarmSnoozeTime != rhs.mAlarmSnoozeTime || |
56 | mAlarmRepeatCount != rhs.mAlarmRepeatCount || | 58 | mAlarmRepeatCount != rhs.mAlarmRepeatCount || |
57 | mAlarmEnabled != rhs.mAlarmEnabled || | 59 | mAlarmEnabled != rhs.mAlarmEnabled || |
58 | mHasTime != rhs.mHasTime) | 60 | mHasTime != rhs.mHasTime) |
59 | return false; | 61 | return false; |
60 | 62 | ||
@@ -183,102 +185,102 @@ void Alarm::setProcedureAlarm(const QString &programFile, const QString &argumen | |||
183 | mFile = programFile; | 185 | mFile = programFile; |
184 | mDescription = arguments; | 186 | mDescription = arguments; |
185 | mParent->updated(); | 187 | mParent->updated(); |
186 | } | 188 | } |
187 | 189 | ||
188 | void Alarm::setProgramFile(const QString &programFile) | 190 | void Alarm::setProgramFile(const QString &programFile) |
189 | { | 191 | { |
190 | if (mType == Procedure) { | 192 | if (mType == Procedure) { |
191 | mFile = programFile; | 193 | mFile = programFile; |
192 | mParent->updated(); | 194 | mParent->updated(); |
193 | } | 195 | } |
194 | } | 196 | } |
195 | 197 | ||
196 | QString Alarm::programFile() const | 198 | QString Alarm::programFile() const |
197 | { | 199 | { |
198 | return (mType == Procedure) ? mFile : QString::null; | 200 | return (mType == Procedure) ? mFile : QString::null; |
199 | } | 201 | } |
200 | 202 | ||
201 | void Alarm::setProgramArguments(const QString &arguments) | 203 | void Alarm::setProgramArguments(const QString &arguments) |
202 | { | 204 | { |
203 | if (mType == Procedure) { | 205 | if (mType == Procedure) { |
204 | mDescription = arguments; | 206 | mDescription = arguments; |
205 | mParent->updated(); | 207 | mParent->updated(); |
206 | } | 208 | } |
207 | } | 209 | } |
208 | 210 | ||
209 | QString Alarm::programArguments() const | 211 | QString Alarm::programArguments() const |
210 | { | 212 | { |
211 | return (mType == Procedure) ? mDescription : QString::null; | 213 | return (mType == Procedure) ? mDescription : QString::null; |
212 | } | 214 | } |
213 | 215 | ||
214 | void Alarm::setEmailAlarm(const QString &subject, const QString &text, | 216 | void Alarm::setEmailAlarm(const QString &subject, const QString &text, |
215 | const QValueList<Person> &addressees, const QStringList &attachments) | 217 | const Q3ValueList<Person> &addressees, const QStringList &attachments) |
216 | { | 218 | { |
217 | mType = Email; | 219 | mType = Email; |
218 | mMailSubject = subject; | 220 | mMailSubject = subject; |
219 | mDescription = text; | 221 | mDescription = text; |
220 | mMailAddresses = addressees; | 222 | mMailAddresses = addressees; |
221 | mMailAttachFiles = attachments; | 223 | mMailAttachFiles = attachments; |
222 | mParent->updated(); | 224 | mParent->updated(); |
223 | } | 225 | } |
224 | 226 | ||
225 | void Alarm::setMailAddress(const Person &mailAddress) | 227 | void Alarm::setMailAddress(const Person &mailAddress) |
226 | { | 228 | { |
227 | if (mType == Email) { | 229 | if (mType == Email) { |
228 | mMailAddresses.clear(); | 230 | mMailAddresses.clear(); |
229 | mMailAddresses += mailAddress; | 231 | mMailAddresses += mailAddress; |
230 | mParent->updated(); | 232 | mParent->updated(); |
231 | } | 233 | } |
232 | } | 234 | } |
233 | 235 | ||
234 | void Alarm::setMailAddresses(const QValueList<Person> &mailAddresses) | 236 | void Alarm::setMailAddresses(const Q3ValueList<Person> &mailAddresses) |
235 | { | 237 | { |
236 | if (mType == Email) { | 238 | if (mType == Email) { |
237 | mMailAddresses = mailAddresses; | 239 | mMailAddresses = mailAddresses; |
238 | mParent->updated(); | 240 | mParent->updated(); |
239 | } | 241 | } |
240 | } | 242 | } |
241 | 243 | ||
242 | void Alarm::addMailAddress(const Person &mailAddress) | 244 | void Alarm::addMailAddress(const Person &mailAddress) |
243 | { | 245 | { |
244 | if (mType == Email) { | 246 | if (mType == Email) { |
245 | mMailAddresses += mailAddress; | 247 | mMailAddresses += mailAddress; |
246 | mParent->updated(); | 248 | mParent->updated(); |
247 | } | 249 | } |
248 | } | 250 | } |
249 | 251 | ||
250 | QValueList<Person> Alarm::mailAddresses() const | 252 | Q3ValueList<Person> Alarm::mailAddresses() const |
251 | { | 253 | { |
252 | return (mType == Email) ? mMailAddresses : QValueList<Person>(); | 254 | return (mType == Email) ? mMailAddresses : Q3ValueList<Person>(); |
253 | } | 255 | } |
254 | 256 | ||
255 | void Alarm::setMailSubject(const QString &mailAlarmSubject) | 257 | void Alarm::setMailSubject(const QString &mailAlarmSubject) |
256 | { | 258 | { |
257 | if (mType == Email) { | 259 | if (mType == Email) { |
258 | mMailSubject = mailAlarmSubject; | 260 | mMailSubject = mailAlarmSubject; |
259 | mParent->updated(); | 261 | mParent->updated(); |
260 | } | 262 | } |
261 | } | 263 | } |
262 | 264 | ||
263 | QString Alarm::mailSubject() const | 265 | QString Alarm::mailSubject() const |
264 | { | 266 | { |
265 | return (mType == Email) ? mMailSubject : QString::null; | 267 | return (mType == Email) ? mMailSubject : QString::null; |
266 | } | 268 | } |
267 | 269 | ||
268 | void Alarm::setMailAttachment(const QString &mailAttachFile) | 270 | void Alarm::setMailAttachment(const QString &mailAttachFile) |
269 | { | 271 | { |
270 | if (mType == Email) { | 272 | if (mType == Email) { |
271 | mMailAttachFiles.clear(); | 273 | mMailAttachFiles.clear(); |
272 | mMailAttachFiles += mailAttachFile; | 274 | mMailAttachFiles += mailAttachFile; |
273 | mParent->updated(); | 275 | mParent->updated(); |
274 | } | 276 | } |
275 | } | 277 | } |
276 | 278 | ||
277 | void Alarm::setMailAttachments(const QStringList &mailAttachFiles) | 279 | void Alarm::setMailAttachments(const QStringList &mailAttachFiles) |
278 | { | 280 | { |
279 | if (mType == Email) { | 281 | if (mType == Email) { |
280 | mMailAttachFiles = mailAttachFiles; | 282 | mMailAttachFiles = mailAttachFiles; |
281 | mParent->updated(); | 283 | mParent->updated(); |
282 | } | 284 | } |
283 | } | 285 | } |
284 | 286 | ||