summaryrefslogtreecommitdiffabout
path: root/korganizer/outgoingdialog.cpp
Unidiff
Diffstat (limited to 'korganizer/outgoingdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/outgoingdialog.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/korganizer/outgoingdialog.cpp b/korganizer/outgoingdialog.cpp
index 7253c8e..ab31274 100644
--- a/korganizer/outgoingdialog.cpp
+++ b/korganizer/outgoingdialog.cpp
@@ -18,13 +18,13 @@
18*/ 18*/
19 19
20#include <kdebug.h> 20#include <kdebug.h>
21 21
22#include <qfile.h> 22#include <qfile.h>
23#include <qdir.h> 23#include <qdir.h>
24#include <qtextstream.h> 24#include <q3textstream.h>
25 25
26#include <kglobal.h> 26#include <kglobal.h>
27#include <klocale.h> 27#include <klocale.h>
28#include <ktempfile.h> 28#include <ktempfile.h>
29#include <kstandarddirs.h> 29#include <kstandarddirs.h>
30 30
@@ -41,16 +41,16 @@
41 41
42#include "koprefs.h" 42#include "koprefs.h"
43#include "outgoingdialog.h" 43#include "outgoingdialog.h"
44#include "koeventviewerdialog.h" 44#include "koeventviewerdialog.h"
45#include "docprefs.h" 45#include "docprefs.h"
46 46
47ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, 47ScheduleItemOut::ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev,
48 Scheduler::Method method, 48 Scheduler::Method method,
49 const QString &recipients) 49 const QString &recipients)
50 : QListViewItem(parent) 50 : Q3ListViewItem(parent)
51{ 51{
52 mIncidence = ev; 52 mIncidence = ev;
53 mMethod = method; 53 mMethod = method;
54 mRecipients = recipients; 54 mRecipients = recipients;
55 55
56// kdDebug() << "ScheduleItemOut: setting the summary" << endl; 56// kdDebug() << "ScheduleItemOut: setting the summary" << endl;
@@ -120,13 +120,13 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
120 //Set the Method 120 //Set the Method
121 setText(5,Scheduler::translatedMethodName(mMethod)); 121 setText(5,Scheduler::translatedMethodName(mMethod));
122} 122}
123 123
124OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, 124OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent,
125 const char* name,bool modal, 125 const char* name,bool modal,
126 WFlags fl) 126 Qt::WFlags fl)
127 : OutgoingDialog_base(parent,name,modal,fl) 127 : OutgoingDialog_base(parent,name,modal,fl)
128{ 128{
129 mCalendar = calendar; 129 mCalendar = calendar;
130 130
131 mFormat = new ICalFormat; 131 mFormat = new ICalFormat;
132 132
@@ -136,18 +136,18 @@ OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent,
136#ifndef KORG_NOMAIL 136#ifndef KORG_NOMAIL
137 mScheduler = new MailScheduler(mCalendar); 137 mScheduler = new MailScheduler(mCalendar);
138#else 138#else
139 mScheduler = new DummyScheduler(mCalendar); 139 mScheduler = new DummyScheduler(mCalendar);
140#endif 140#endif
141 } 141 }
142 mMessageListView->setColumnAlignment(1,AlignHCenter); 142 mMessageListView->setColumnAlignment(1,Qt::AlignHCenter);
143 mMessageListView->setColumnAlignment(2,AlignHCenter); 143 mMessageListView->setColumnAlignment(2,Qt::AlignHCenter);
144 mMessageListView->setColumnAlignment(3,AlignHCenter); 144 mMessageListView->setColumnAlignment(3,Qt::AlignHCenter);
145 mMessageListView->setColumnAlignment(4,AlignHCenter); 145 mMessageListView->setColumnAlignment(4,Qt::AlignHCenter);
146 QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), 146 QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)),
147 this,SLOT(showEvent(QListViewItem *))); 147 this,SLOT(showEvent(Q3ListViewItem *)));
148 mDocPrefs = new DocPrefs("groupschedule"); 148 mDocPrefs = new DocPrefs("groupschedule");
149 loadMessages(); 149 loadMessages();
150} 150}
151 151
152OutgoingDialog::~OutgoingDialog() 152OutgoingDialog::~OutgoingDialog()
153{ 153{
@@ -233,13 +233,13 @@ void OutgoingDialog::deleteItem()
233 deleteMessage(item->event()); 233 deleteMessage(item->event());
234 delete(item->event()); 234 delete(item->event());
235 mMessageListView->takeItem(item); 235 mMessageListView->takeItem(item);
236 emit numMessagesChanged(mMessageListView->childCount()); 236 emit numMessagesChanged(mMessageListView->childCount());
237} 237}
238 238
239void OutgoingDialog::showEvent(QListViewItem *qitem) 239void OutgoingDialog::showEvent(Q3ListViewItem *qitem)
240{ 240{
241 ScheduleItemOut *item = (ScheduleItemOut *)qitem; 241 ScheduleItemOut *item = (ScheduleItemOut *)qitem;
242 Event *event = 0; 242 Event *event = 0;
243 Todo *todo = 0; 243 Todo *todo = 0;
244 if ( item->event()->typeID() == eventID ) { 244 if ( item->event()->typeID() == eventID ) {
245 event = static_cast<Event *>(item->event()); 245 event = static_cast<Event *>(item->event());
@@ -291,13 +291,13 @@ void OutgoingDialog::showEvent(QListViewItem *qitem)
291 291
292bool OutgoingDialog::saveMessage(IncidenceBase *incidence,Scheduler::Method method, 292bool OutgoingDialog::saveMessage(IncidenceBase *incidence,Scheduler::Method method,
293 const QString &recipients) 293 const QString &recipients)
294{ 294{
295 KTempFile ktfile(locateLocal("data","korganizer/outgoing/"),"ics"); 295 KTempFile ktfile(locateLocal("data","korganizer/outgoing/"),"ics");
296 QString messageText = mFormat->createScheduleMessage(incidence,method); 296 QString messageText = mFormat->createScheduleMessage(incidence,method);
297 QTextStream *qts = ktfile.textStream(); 297 Q3TextStream *qts = ktfile.textStream();
298 *qts << messageText; 298 *qts << messageText;
299 *qts << "METHOD-BEGIN:" << endl << method << endl << ":METHOD-END" << endl; 299 *qts << "METHOD-BEGIN:" << endl << method << endl << ":METHOD-END" << endl;
300 *qts << "RECIPIENTS-BEGIN:" << endl << recipients << endl << ":RECIPIENTS-END" << endl; 300 *qts << "RECIPIENTS-BEGIN:" << endl << recipients << endl << ":RECIPIENTS-END" << endl;
301 mMessageMap[incidence]=ktfile.name(); 301 mMessageMap[incidence]=ktfile.name();
302 302
303 return true; 303 return true;
@@ -327,17 +327,17 @@ void OutgoingDialog::loadMessages()
327 bool inserted = false; 327 bool inserted = false;
328 QMap<IncidenceBase*, QString>::Iterator iter; 328 QMap<IncidenceBase*, QString>::Iterator iter;
329 for ( iter = mMessageMap.begin(); iter != mMessageMap.end(); ++iter ) { 329 for ( iter = mMessageMap.begin(); iter != mMessageMap.end(); ++iter ) {
330 if (iter.data() == outgoingDirName + "/" + (*it)) inserted = true; 330 if (iter.data() == outgoingDirName + "/" + (*it)) inserted = true;
331 } 331 }
332 if (!inserted) { 332 if (!inserted) {
333 if (!f.open(IO_ReadOnly)) { 333 if (!f.open(QIODevice::ReadOnly)) {
334 kdDebug() << "OutgoingDialog::loadMessage(): Can't open file'" 334 kdDebug() << "OutgoingDialog::loadMessage(): Can't open file'"
335 << (*it) << "'" << endl; 335 << (*it) << "'" << endl;
336 } else { 336 } else {
337 QTextStream t(&f); 337 Q3TextStream t(&f);
338 QString messageString = t.read(); 338 QString messageString = t.read();
339 ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar, 339 ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar,
340 messageString); 340 messageString);
341 int begin_pos = messageString.find("METHOD-BEGIN:"); 341 int begin_pos = messageString.find("METHOD-BEGIN:");
342 begin_pos = messageString.find('\n',begin_pos)+1; 342 begin_pos = messageString.find('\n',begin_pos)+1;
343 QString meth = messageString.mid(begin_pos,1); 343 QString meth = messageString.mid(begin_pos,1);