summaryrefslogtreecommitdiffabout
path: root/libkcal/scheduler.cpp
Unidiff
Diffstat (limited to 'libkcal/scheduler.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/scheduler.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/libkcal/scheduler.cpp b/libkcal/scheduler.cpp
index 253d8b7..234cfcf 100644
--- a/libkcal/scheduler.cpp
+++ b/libkcal/scheduler.cpp
@@ -11,25 +11,27 @@
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qdir.h> 21#include <qdir.h>
22#include <qfile.h> 22#include <qfile.h>
23#include <qtextstream.h> 23#include <q3textstream.h>
24//Added by qt3to4:
25#include <Q3PtrList>
24 26
25#include <klocale.h> 27#include <klocale.h>
26#include <kdebug.h> 28#include <kdebug.h>
27#include <kstandarddirs.h> 29#include <kstandarddirs.h>
28 30
29#include "event.h" 31#include "event.h"
30#include "todo.h" 32#include "todo.h"
31#include "freebusy.h" 33#include "freebusy.h"
32#include "icalformat.h" 34#include "icalformat.h"
33#include "calendar.h" 35#include "calendar.h"
34 36
35#include "scheduler.h" 37#include "scheduler.h"
@@ -255,26 +257,26 @@ bool Scheduler::acceptDeclineCounter(IncidenceBase *incidence,ScheduleMessage::S
255 257
256bool Scheduler::acceptReply(IncidenceBase *incidence,ScheduleMessage::Status status, Method method) 258bool Scheduler::acceptReply(IncidenceBase *incidence,ScheduleMessage::Status status, Method method)
257{ 259{
258 if(incidence->type()=="FreeBusy") { 260 if(incidence->type()=="FreeBusy") {
259 return acceptFreeBusy(incidence, method); 261 return acceptFreeBusy(incidence, method);
260 } 262 }
261 bool ret = false; 263 bool ret = false;
262 Event *ev = mCalendar->event(incidence->uid()); 264 Event *ev = mCalendar->event(incidence->uid());
263 Todo *to = mCalendar->todo(incidence->uid()); 265 Todo *to = mCalendar->todo(incidence->uid());
264 if (ev || to) { 266 if (ev || to) {
265 //get matching attendee in calendar 267 //get matching attendee in calendar
266 kdDebug(5800) << "Scheduler::acceptTransaction match found!" << endl; 268 kdDebug(5800) << "Scheduler::acceptTransaction match found!" << endl;
267 QPtrList<Attendee> attendeesIn = incidence->attendees(); 269 Q3PtrList<Attendee> attendeesIn = incidence->attendees();
268 QPtrList<Attendee> attendeesEv; 270 Q3PtrList<Attendee> attendeesEv;
269 if (ev) attendeesEv = ev->attendees(); 271 if (ev) attendeesEv = ev->attendees();
270 if (to) attendeesEv = to->attendees(); 272 if (to) attendeesEv = to->attendees();
271 Attendee *attIn; 273 Attendee *attIn;
272 Attendee *attEv; 274 Attendee *attEv;
273 for ( attIn = attendeesIn.first(); attIn; attIn = attendeesIn.next() ) { 275 for ( attIn = attendeesIn.first(); attIn; attIn = attendeesIn.next() ) {
274 for ( attEv = attendeesEv.first(); attEv; attEv = attendeesEv.next() ) { 276 for ( attEv = attendeesEv.first(); attEv; attEv = attendeesEv.next() ) {
275 if (attIn->email()==attEv->email()) { 277 if (attIn->email()==attEv->email()) {
276 //update attendee-info 278 //update attendee-info
277 kdDebug(5800) << "Scheduler::acceptTransaction update attendee" << endl; 279 kdDebug(5800) << "Scheduler::acceptTransaction update attendee" << endl;
278 attEv->setStatus(attIn->status()); 280 attEv->setStatus(attIn->status());
279 attEv->setRSVP(false); 281 attEv->setRSVP(false);
280 // better to not update the sequence number with replys 282 // better to not update the sequence number with replys
@@ -333,23 +335,23 @@ bool Scheduler::acceptFreeBusy(IncidenceBase *incidence, Method method)
333 filename += "/"; 335 filename += "/";
334 filename += from; 336 filename += from;
335 filename += ".ifb"; 337 filename += ".ifb";
336 QFile f(filename); 338 QFile f(filename);
337 339
338 kdDebug() << "acceptFreeBusy: filename" << filename << endl; 340 kdDebug() << "acceptFreeBusy: filename" << filename << endl;
339 341
340 freebusy->clearAttendees(); 342 freebusy->clearAttendees();
341 freebusy->setOrganizer(from); 343 freebusy->setOrganizer(from);
342 344
343 QString messageText = mFormat->createScheduleMessage(freebusy, Publish); 345 QString messageText = mFormat->createScheduleMessage(freebusy, Publish);
344 346
345 if (!f.open(IO_ReadWrite)) { 347 if (!f.open(QIODevice::ReadWrite)) {
346 kdDebug() << "acceptFreeBusy: Can't open:" << filename << " for writing" << endl; 348 kdDebug() << "acceptFreeBusy: Can't open:" << filename << " for writing" << endl;
347 return false; 349 return false;
348 } 350 }
349 QTextStream t(&f); 351 Q3TextStream t(&f);
350 t << messageText; 352 t << messageText;
351 f.close(); 353 f.close();
352 354
353 deleteTransaction(incidence); 355 deleteTransaction(incidence);
354 return true; 356 return true;
355} 357}