summaryrefslogtreecommitdiffabout
path: root/korganizer/outgoingdialog.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/outgoingdialog.cpp') (more/less context) (ignore 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
@@ -8,59 +8,59 @@
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <kdebug.h>
#include <qfile.h>
#include <qdir.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <kglobal.h>
#include <klocale.h>
#include <ktempfile.h>
#include <kstandarddirs.h>
#include <libkcal/event.h>
#include <libkcal/freebusy.h>
//#include <libkcal/imipscheduler.h>
#include <libkcal/dummyscheduler.h>
#include <libkcal/icalformat.h>
#include <libkcal/calendar.h>
#ifndef KORG_NOMAIL
#include "mailscheduler.h"
#endif
#include "koprefs.h"
#include "outgoingdialog.h"
#include "koeventviewerdialog.h"
#include "docprefs.h"
-ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
+ScheduleItemOut::ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev,
Scheduler::Method method,
const QString &recipients)
- : QListViewItem(parent)
+ : Q3ListViewItem(parent)
{
mIncidence = ev;
mMethod = method;
mRecipients = recipients;
// kdDebug() << "ScheduleItemOut: setting the summary" << endl;
//Set the summary
if(ev->typeID() != freebusyID ) {
Incidence *incidence = static_cast<Incidence *>(ev);
setText(0,incidence->summary());
} else {
setText(0,i18n("Free Busy Object"));
}
// kdDebug() << "ScheduleItemOut: checking if the object is an event" << endl;
//If the object is an event
@@ -110,54 +110,54 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
FreeBusy *freebusy = static_cast<FreeBusy *>(ev);
setText(1,freebusy->dtStartDateStr());
setText(2,freebusy->dtStartTimeStr());
//Must try and get this to the users local settings
setText(3,KGlobal::locale()->formatDate( freebusy->dtEnd().date() ) );
setText(4,KGlobal::locale()->formatTime( freebusy->dtEnd().time() ) );
}
// kdDebug() << "ScheduleItemOut: Setting the method" << endl;
//Set the Method
setText(5,Scheduler::translatedMethodName(mMethod));
}
OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent,
const char* name,bool modal,
- WFlags fl)
+ Qt::WFlags fl)
: OutgoingDialog_base(parent,name,modal,fl)
{
mCalendar = calendar;
mFormat = new ICalFormat;
if (KOPrefs::instance()->mIMIPScheduler == KOPrefs::IMIPDummy ) {
mScheduler = new DummyScheduler(mCalendar);
} else {
#ifndef KORG_NOMAIL
mScheduler = new MailScheduler(mCalendar);
#else
mScheduler = new DummyScheduler(mCalendar);
#endif
}
- mMessageListView->setColumnAlignment(1,AlignHCenter);
- mMessageListView->setColumnAlignment(2,AlignHCenter);
- mMessageListView->setColumnAlignment(3,AlignHCenter);
- mMessageListView->setColumnAlignment(4,AlignHCenter);
- QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)),
- this,SLOT(showEvent(QListViewItem *)));
+ mMessageListView->setColumnAlignment(1,Qt::AlignHCenter);
+ mMessageListView->setColumnAlignment(2,Qt::AlignHCenter);
+ mMessageListView->setColumnAlignment(3,Qt::AlignHCenter);
+ mMessageListView->setColumnAlignment(4,Qt::AlignHCenter);
+ QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)),
+ this,SLOT(showEvent(Q3ListViewItem *)));
mDocPrefs = new DocPrefs("groupschedule");
loadMessages();
}
OutgoingDialog::~OutgoingDialog()
{
delete mDocPrefs;
delete mFormat;
}
bool OutgoingDialog::addMessage(IncidenceBase *incidence,Scheduler::Method method)
{
kdDebug() << "Outgoing::addMessage" << "Method:" << method << endl;
if (method == Scheduler::Publish) return false;
if( mDocPrefs ) {
if (method != Scheduler::Cancel) {
@@ -223,33 +223,33 @@ void OutgoingDialog::send()
}
emit numMessagesChanged(mMessageListView->childCount());
}
void OutgoingDialog::deleteItem()
{
ScheduleItemOut *item = (ScheduleItemOut *)(mMessageListView->selectedItem());
if(!item)
return;
deleteMessage(item->event());
delete(item->event());
mMessageListView->takeItem(item);
emit numMessagesChanged(mMessageListView->childCount());
}
-void OutgoingDialog::showEvent(QListViewItem *qitem)
+void OutgoingDialog::showEvent(Q3ListViewItem *qitem)
{
ScheduleItemOut *item = (ScheduleItemOut *)qitem;
Event *event = 0;
Todo *todo = 0;
if ( item->event()->typeID() == eventID ) {
event = static_cast<Event *>(item->event());
}
if ( item->event()->typeID() == todoID ) {
todo = static_cast<Todo *>(item->event());
}
QString sendText;
if (event || todo) {
KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this);
if (event) eventViewer->setEvent(event);
if (todo) eventViewer->setTodo(todo);
sendText = "<hr><h4>"+i18n("Event will be sent to:")+"</h4>";
@@ -281,33 +281,33 @@ void OutgoingDialog::showEvent(QListViewItem *qitem)
case Scheduler::NoMethod: {
sendText += "";
break; }
default:
sendText = "";
}
eventViewer->addText(sendText);
eventViewer->show();
}
}
bool OutgoingDialog::saveMessage(IncidenceBase *incidence,Scheduler::Method method,
const QString &recipients)
{
KTempFile ktfile(locateLocal("data","korganizer/outgoing/"),"ics");
QString messageText = mFormat->createScheduleMessage(incidence,method);
- QTextStream *qts = ktfile.textStream();
+ Q3TextStream *qts = ktfile.textStream();
*qts << messageText;
*qts << "METHOD-BEGIN:" << endl << method << endl << ":METHOD-END" << endl;
*qts << "RECIPIENTS-BEGIN:" << endl << recipients << endl << ":RECIPIENTS-END" << endl;
mMessageMap[incidence]=ktfile.name();
return true;
}
bool OutgoingDialog::deleteMessage(IncidenceBase *incidence)
{
QFile f( mMessageMap[incidence] );
mMessageMap.remove(incidence);
if ( !f.exists() ) return false;
else
return f.remove();
}
@@ -317,37 +317,37 @@ void OutgoingDialog::loadMessages()
Scheduler::Method method;
QString recipients;
QString outgoingDirName = locateLocal("data","korganizer/outgoing");
QDir outgoingDir(outgoingDirName);
QStringList outgoing = outgoingDir.entryList(QDir::Files);
QStringList::ConstIterator it;
for(it = outgoing.begin(); it != outgoing.end(); ++it) {
kdDebug() << "-- File: " << (*it) << endl;
QFile f(outgoingDirName + "/" + (*it));
bool inserted = false;
QMap<IncidenceBase*, QString>::Iterator iter;
for ( iter = mMessageMap.begin(); iter != mMessageMap.end(); ++iter ) {
if (iter.data() == outgoingDirName + "/" + (*it)) inserted = true;
}
if (!inserted) {
- if (!f.open(IO_ReadOnly)) {
+ if (!f.open(QIODevice::ReadOnly)) {
kdDebug() << "OutgoingDialog::loadMessage(): Can't open file'"
<< (*it) << "'" << endl;
} else {
- QTextStream t(&f);
+ Q3TextStream t(&f);
QString messageString = t.read();
ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar,
messageString);
int begin_pos = messageString.find("METHOD-BEGIN:");
begin_pos = messageString.find('\n',begin_pos)+1;
QString meth = messageString.mid(begin_pos,1);
switch (meth.toInt()) {
case 0:method=Scheduler::Publish; break;
case 1:method=Scheduler::Request; break;
case 2:method=Scheduler::Refresh; break;
case 3:method=Scheduler::Cancel; break;
case 4:method=Scheduler::Add; break;
case 5:method=Scheduler::Reply; break;
case 6:method=Scheduler::Counter; break;
case 7:method=Scheduler::Declinecounter; break;
default :method=Scheduler::NoMethod; break;