summaryrefslogtreecommitdiffabout
path: root/libkcal/alarm.cpp
authorzautrix <zautrix>2004-09-14 01:03:08 (UTC)
committer zautrix <zautrix>2004-09-14 01:03:08 (UTC)
commit30762fe125216362e1a6c1d5ec5d22d9525aa336 (patch) (side-by-side diff)
tree4ff0fbf43efa921c86d64ff3f50baa9e59d207d9 /libkcal/alarm.cpp
parent8ce7eae438dcd20f9c79fc0a36dfef0a6d3931eb (diff)
downloadkdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.zip
kdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.tar.gz
kdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.tar.bz2
Many bugfixes
Diffstat (limited to 'libkcal/alarm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/alarm.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 29e6205..1fc7169 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -4,112 +4,146 @@
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <kdebug.h>
#include "incidence.h"
#include "todo.h"
#include "alarm.h"
using namespace KCal;
#include <qwidget.h>
Alarm::Alarm(Incidence *parent)
: mParent(parent),
mType(Audio),
mDescription(""), // to make operator==() not fail
mFile(""), // to make operator==() not fail
mMailSubject(""), // to make operator==() not fail
mAlarmSnoozeTime(5),
mAlarmRepeatCount(0),
mEndOffset(false),
mHasTime(false),
mAlarmEnabled(false)
{
}
Alarm::~Alarm()
{
}
bool Alarm::operator==( const Alarm& rhs ) const
{
+
if ( mType != rhs.mType ||
mAlarmSnoozeTime != rhs.mAlarmSnoozeTime ||
mAlarmRepeatCount != rhs.mAlarmRepeatCount ||
mAlarmEnabled != rhs.mAlarmEnabled ||
mHasTime != rhs.mHasTime)
return false;
+#if 0
+ if ( mType != rhs.mType ) {
+
+ qDebug("aaa1 ");
+ return false;
+ }
+
+ if ( mAlarmSnoozeTime != rhs.mAlarmSnoozeTime ) {
+
+ qDebug("aaa2 ");
+ return false;
+ }
+
+
+ if ( mAlarmRepeatCount != rhs.mAlarmRepeatCount ) {
+
+ qDebug("aaa3 ");
+ return false;
+ }
+
+ if ( mAlarmEnabled != rhs.mAlarmEnabled ) {
+
+ qDebug("aaa4 ");
+ return false;
+ }
+
+ if ( mHasTime != rhs.mHasTime ) {
+
+ qDebug("aaa5 ");
+ return false;
+ }
+#endif
+
+
if (mHasTime) {
if (mAlarmTime != rhs.mAlarmTime)
return false;
} else {
if (mOffset != rhs.mOffset ||
mEndOffset != rhs.mEndOffset)
return false;
}
-
switch (mType) {
case Display:
return mDescription == rhs.mDescription;
case Email:
return mDescription == rhs.mDescription &&
mMailAttachFiles == rhs.mMailAttachFiles &&
mMailAddresses == rhs.mMailAddresses &&
mMailSubject == rhs.mMailSubject;
case Procedure:
return mFile == rhs.mFile &&
mDescription == rhs.mDescription;
case Audio:
return mFile == rhs.mFile;
case Invalid:
break;
}
return false;
}
void Alarm::setType(Alarm::Type type)
{
if (type == mType)
return;
switch (type) {
case Display:
mDescription = "";
break;
case Procedure:
mFile = mDescription = "";
break;
case Audio:
mFile = "";
break;
case Email:
mMailSubject = mDescription = "";
mMailAddresses.clear();
mMailAttachFiles.clear();
break;
case Invalid:
break;
default:
return;
}