-rw-r--r-- | libkcal/vcalformat.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index 1167e58..076cd3f 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp | |||
@@ -40,16 +40,17 @@ | |||
40 | #include "calendar.h" | 40 | #include "calendar.h" |
41 | 41 | ||
42 | #include "vcalformat.h" | 42 | #include "vcalformat.h" |
43 | 43 | ||
44 | using namespace KCal; | 44 | using namespace KCal; |
45 | 45 | ||
46 | VCalFormat::VCalFormat() | 46 | VCalFormat::VCalFormat() |
47 | { | 47 | { |
48 | mCalendar = 0; | ||
48 | } | 49 | } |
49 | 50 | ||
50 | VCalFormat::~VCalFormat() | 51 | VCalFormat::~VCalFormat() |
51 | { | 52 | { |
52 | } | 53 | } |
53 | 54 | ||
54 | bool VCalFormat::load(Calendar *calendar, const QString &fileName) | 55 | bool VCalFormat::load(Calendar *calendar, const QString &fileName) |
55 | { | 56 | { |
@@ -160,28 +161,30 @@ bool VCalFormat::fromString( Calendar *calendar, const QString &text ) | |||
160 | return false; | 161 | return false; |
161 | } | 162 | } |
162 | 163 | ||
163 | deleteVObject( vcal ); | 164 | deleteVObject( vcal ); |
164 | 165 | ||
165 | return true; | 166 | return true; |
166 | } | 167 | } |
167 | 168 | ||
168 | QString VCalFormat::eventToString( Event * event) | 169 | QString VCalFormat::eventToString( Event * event, Calendar *calendar) |
169 | { | 170 | { |
170 | if ( !event ) return QString::null; | 171 | if ( !event ) return QString::null; |
172 | mCalendar = calendar; | ||
171 | VObject *vevent = eventToVEvent( event ); | 173 | VObject *vevent = eventToVEvent( event ); |
172 | char *buf = writeMemVObject( 0, 0, vevent ); | 174 | char *buf = writeMemVObject( 0, 0, vevent ); |
173 | QString result( buf ); | 175 | QString result( buf ); |
174 | cleanVObject( vevent ); | 176 | cleanVObject( vevent ); |
175 | return result; | 177 | return result; |
176 | } | 178 | } |
177 | QString VCalFormat::todoToString( Todo * todo ) | 179 | QString VCalFormat::todoToString( Todo * todo, Calendar *calendar ) |
178 | { | 180 | { |
179 | if ( !todo ) return QString::null; | 181 | if ( !todo ) return QString::null; |
182 | mCalendar = calendar; | ||
180 | VObject *vevent = eventToVTodo( todo ); | 183 | VObject *vevent = eventToVTodo( todo ); |
181 | char *buf = writeMemVObject( 0, 0, vevent ); | 184 | char *buf = writeMemVObject( 0, 0, vevent ); |
182 | QString result( buf ); | 185 | QString result( buf ); |
183 | cleanVObject( vevent ); | 186 | cleanVObject( vevent ); |
184 | return result; | 187 | return result; |
185 | } | 188 | } |
186 | 189 | ||
187 | QString VCalFormat::toString( Calendar *calendar ) | 190 | QString VCalFormat::toString( Calendar *calendar ) |