summaryrefslogtreecommitdiffabout
path: root/libkcal/alarm.cpp
Unidiff
Diffstat (limited to 'libkcal/alarm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/alarm.cpp10
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
@@ -5,48 +5,50 @@
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
30using namespace KCal; 32using namespace KCal;
31#include <qwidget.h> 33#include <qwidget.h>
32Alarm::Alarm(Incidence *parent) 34Alarm::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
47Alarm::~Alarm() 49Alarm::~Alarm()
48{ 50{
49} 51}
50 52
51bool Alarm::operator==( const Alarm& rhs ) const 53bool Alarm::operator==( const Alarm& rhs ) const
52{ 54{
@@ -191,86 +193,86 @@ void Alarm::setProgramFile(const QString &programFile)
191 mFile = programFile; 193 mFile = programFile;
192 mParent->updated(); 194 mParent->updated();
193 } 195 }
194} 196}
195 197
196QString Alarm::programFile() const 198QString Alarm::programFile() const
197{ 199{
198 return (mType == Procedure) ? mFile : QString::null; 200 return (mType == Procedure) ? mFile : QString::null;
199} 201}
200 202
201void Alarm::setProgramArguments(const QString &arguments) 203void 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
209QString Alarm::programArguments() const 211QString Alarm::programArguments() const
210{ 212{
211 return (mType == Procedure) ? mDescription : QString::null; 213 return (mType == Procedure) ? mDescription : QString::null;
212} 214}
213 215
214void Alarm::setEmailAlarm(const QString &subject, const QString &text, 216void 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
225void Alarm::setMailAddress(const Person &mailAddress) 227void 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
234void Alarm::setMailAddresses(const QValueList<Person> &mailAddresses) 236void 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
242void Alarm::addMailAddress(const Person &mailAddress) 244void 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
250QValueList<Person> Alarm::mailAddresses() const 252Q3ValueList<Person> Alarm::mailAddresses() const
251{ 253{
252 return (mType == Email) ? mMailAddresses : QValueList<Person>(); 254 return (mType == Email) ? mMailAddresses : Q3ValueList<Person>();
253} 255}
254 256
255void Alarm::setMailSubject(const QString &mailAlarmSubject) 257void 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
263QString Alarm::mailSubject() const 265QString Alarm::mailSubject() const
264{ 266{
265 return (mType == Email) ? mMailSubject : QString::null; 267 return (mType == Email) ? mMailSubject : QString::null;
266} 268}
267 269
268void Alarm::setMailAttachment(const QString &mailAttachFile) 270void 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