-rw-r--r-- | libkcal/scheduler.cpp | 12 |
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 @@ -1,47 +1,49 @@ /* This file is part of libkcal. 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 <qdir.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> +//Added by qt3to4: +#include <Q3PtrList> #include <klocale.h> #include <kdebug.h> #include <kstandarddirs.h> #include "event.h" #include "todo.h" #include "freebusy.h" #include "icalformat.h" #include "calendar.h" #include "scheduler.h" using namespace KCal; ScheduleMessage::ScheduleMessage(IncidenceBase *incidence,int method,ScheduleMessage::Status status) { mIncidence = incidence; mMethod = method; mStatus = status; } QString ScheduleMessage::statusName(ScheduleMessage::Status status) { @@ -243,50 +245,50 @@ bool Scheduler::acceptCancel(IncidenceBase *incidence,ScheduleMessage::Status st bool Scheduler::acceptDeclineCounter(IncidenceBase *incidence,ScheduleMessage::Status status) { deleteTransaction(incidence); return false; } //bool Scheduler::acceptFreeBusy(Incidence *incidence,ScheduleMessage::Status status) //{ // deleteTransaction(incidence); // return false; //} bool Scheduler::acceptReply(IncidenceBase *incidence,ScheduleMessage::Status status, Method method) { if(incidence->type()=="FreeBusy") { return acceptFreeBusy(incidence, method); } bool ret = false; Event *ev = mCalendar->event(incidence->uid()); Todo *to = mCalendar->todo(incidence->uid()); if (ev || to) { //get matching attendee in calendar kdDebug(5800) << "Scheduler::acceptTransaction match found!" << endl; - QPtrList<Attendee> attendeesIn = incidence->attendees(); - QPtrList<Attendee> attendeesEv; + Q3PtrList<Attendee> attendeesIn = incidence->attendees(); + Q3PtrList<Attendee> attendeesEv; if (ev) attendeesEv = ev->attendees(); if (to) attendeesEv = to->attendees(); Attendee *attIn; Attendee *attEv; for ( attIn = attendeesIn.first(); attIn; attIn = attendeesIn.next() ) { for ( attEv = attendeesEv.first(); attEv; attEv = attendeesEv.next() ) { if (attIn->email()==attEv->email()) { //update attendee-info kdDebug(5800) << "Scheduler::acceptTransaction update attendee" << endl; attEv->setStatus(attIn->status()); attEv->setRSVP(false); // better to not update the sequence number with replys //if (ev) ev->setRevision(ev->revision()+1); //if (to) to->setRevision(to->revision()+1); ret = true; } } } } if (ret) deleteTransaction(incidence); return ret; } bool Scheduler::acceptRefresh(IncidenceBase *incidence,ScheduleMessage::Status status) @@ -321,35 +323,35 @@ bool Scheduler::acceptFreeBusy(IncidenceBase *incidence, Method method) QDir freeBusyDir(freeBusyDirName); if (!freeBusyDir.exists()) { kdDebug() << "Directory " << freeBusyDirName << " does not exist!" << endl; kdDebug() << "Creating directory: " << freeBusyDirName << endl; if(!freeBusyDir.mkdir(freeBusyDirName, TRUE)) { kdDebug() << "Could not create directory: " << freeBusyDirName << endl; return false; } } QString filename(freeBusyDirName); filename += "/"; filename += from; filename += ".ifb"; QFile f(filename); kdDebug() << "acceptFreeBusy: filename" << filename << endl; freebusy->clearAttendees(); freebusy->setOrganizer(from); QString messageText = mFormat->createScheduleMessage(freebusy, Publish); - if (!f.open(IO_ReadWrite)) { + if (!f.open(QIODevice::ReadWrite)) { kdDebug() << "acceptFreeBusy: Can't open:" << filename << " for writing" << endl; return false; } - QTextStream t(&f); + Q3TextStream t(&f); t << messageText; f.close(); deleteTransaction(incidence); return true; } |