27 #include <tqtextstream.h>
30 #include <kstandarddirs.h>
33 #include "icalformat.h"
35 #include "dummyscheduler.h"
39 DummyScheduler::DummyScheduler(
Calendar *calendar)
44 DummyScheduler::~DummyScheduler()
48 bool DummyScheduler::publish (
IncidenceBase *incidence,
const TQString &)
50 TQString messageText = mFormat->createScheduleMessage(incidence,
53 return saveMessage(messageText);
56 bool DummyScheduler::performTransaction(
IncidenceBase *incidence,Method method,
const TQString &)
58 TQString messageText = mFormat->createScheduleMessage(incidence,method);
60 return saveMessage(messageText);
63 bool DummyScheduler::performTransaction(
IncidenceBase *incidence,Method method)
65 TQString messageText = mFormat->createScheduleMessage(incidence,method);
67 return saveMessage(messageText);
70 bool DummyScheduler::saveMessage(
const TQString &message)
72 TQFile f(
"dummyscheduler.store");
73 if (f.open(IO_WriteOnly | IO_Append)) {
83 TQPtrList<ScheduleMessage> DummyScheduler::retrieveTransactions()
85 TQPtrList<ScheduleMessage> messageList;
87 TQFile f(
"dummyscheduler.store");
88 if (!f.open(IO_ReadOnly)) {
89 kdDebug(5800) <<
"DummyScheduler::retrieveTransactions(): Can't open file"
93 TQString messageString;
94 TQString messageLine = t.readLine();
95 while (!messageLine.isNull()) {
97 messageString += messageLine +
"\n";
98 if (messageLine.find(
"END:VCALENDAR") >= 0) {
99 kdDebug(5800) <<
"---------------" << messageString << endl;
102 kdDebug(5800) <<
"--Parsed" << endl;
104 messageList.append(message);
106 TQString errorMessage;
107 if (mFormat->exception()) {
108 errorMessage = mFormat->exception()->message();
110 kdDebug(5800) <<
"DummyScheduler::retrieveTransactions() Error parsing "
111 "message: " << errorMessage << endl;
115 messageLine = t.readLine();
123 TQString DummyScheduler::freeBusyDir()
This is the main "calendar" object class.
This class provides the base class common to all calendar components.
This class provides an encapsulation of a scheduling message.
This class provides an encapsulation of iTIP transactions.
Namespace KCal is for global classes, objects and/or functions in libkcal.