summaryrefslogtreecommitdiffabout
path: root/libkcal/incidence.cpp
Unidiff
Diffstat (limited to 'libkcal/incidence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidence.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 549014e..39c14f5 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -47,28 +47,35 @@ Incidence::Incidence() :
47} 47}
48 48
49Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) 49Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
50{ 50{
51// TODO: reenable attributes currently commented out. 51// TODO: reenable attributes currently commented out.
52 mRevision = i.mRevision; 52 mRevision = i.mRevision;
53 mCreated = i.mCreated; 53 mCreated = i.mCreated;
54 mDescription = i.mDescription; 54 mDescription = i.mDescription;
55 mSummary = i.mSummary; 55 mSummary = i.mSummary;
56 mCategories = i.mCategories; 56 mCategories = i.mCategories;
57// Incidence *mRelatedTo; Incidence *mRelatedTo; 57// Incidence *mRelatedTo; Incidence *mRelatedTo;
58 mRelatedTo = 0; 58 mRelatedTo = 0;
59 mRelatedToUid = i.mRelatedToUid; 59 mRelatedToUid = i.mRelatedToUid;
60// QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations; 60// QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations;
61 mExDates = i.mExDates; 61 mExDates = i.mExDates;
62 mAttachments = i.mAttachments; 62 QPtrListIterator<Attachment> itat( i.mAttachments );
63 Attachment *at;
64 while( (at = itat.current()) ) {
65 Attachment *a = new Attachment( *at );
66 mAttachments.append( a );
67 ++itat;
68 }
69 mAttachments.setAutoDelete( true );
63 mResources = i.mResources; 70 mResources = i.mResources;
64 mSecrecy = i.mSecrecy; 71 mSecrecy = i.mSecrecy;
65 mPriority = i.mPriority; 72 mPriority = i.mPriority;
66 mLocation = i.mLocation; 73 mLocation = i.mLocation;
67 mCancelled = i.mCancelled; 74 mCancelled = i.mCancelled;
68 mHasStartDate = i.mHasStartDate; 75 mHasStartDate = i.mHasStartDate;
69 QPtrListIterator<Alarm> it( i.mAlarms ); 76 QPtrListIterator<Alarm> it( i.mAlarms );
70 const Alarm *a; 77 const Alarm *a;
71 while( (a = it.current()) ) { 78 while( (a = it.current()) ) {
72 Alarm *b = new Alarm( *a ); 79 Alarm *b = new Alarm( *a );
73 b->setParent( this ); 80 b->setParent( this );
74 mAlarms.append( b ); 81 mAlarms.append( b );
@@ -748,24 +755,25 @@ bool Incidence::isAlarmEnabled() const
748 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { 755 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) {
749 if (alarm->enabled()) 756 if (alarm->enabled())
750 return true; 757 return true;
751 } 758 }
752 return false; 759 return false;
753} 760}
754#include <stdlib.h> 761#include <stdlib.h>
755Recurrence *Incidence::recurrence() 762Recurrence *Incidence::recurrence()
756{ 763{
757 if ( ! mRecurrence ) { 764 if ( ! mRecurrence ) {
758 mRecurrence = new Recurrence(this); 765 mRecurrence = new Recurrence(this);
759 mRecurrence->setRecurStart( dtStart() ); 766 mRecurrence->setRecurStart( dtStart() );
767 mRecurrence->setRecurReadOnly( isReadOnly());
760 //qDebug("creating new recurence "); 768 //qDebug("creating new recurence ");
761 //abort(); 769 //abort();
762 } 770 }
763 return mRecurrence; 771 return mRecurrence;
764} 772}
765void Incidence::setRecurrence( Recurrence * r) 773void Incidence::setRecurrence( Recurrence * r)
766{ 774{
767 if ( mRecurrence ) 775 if ( mRecurrence )
768 delete mRecurrence; 776 delete mRecurrence;
769 mRecurrence = r; 777 mRecurrence = r;
770} 778}
771 779