summaryrefslogtreecommitdiffabout
path: root/kmicromail/opiemail.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/opiemail.cpp47
1 files changed, 26 insertions, 21 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 75a75b9..f453be5 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -1,12 +1,17 @@
// CHANGED 2004-09-31 Lutz Rogowski
// CHANGED 2004-08-06 Lutz Rogowski
#define protected public
#include <qwidget.h>
+//Added by qt3to4:
+#include <Q3ValueList>
+#include <Q3CString>
+#include <QPixmap>
+#include <Q3PopupMenu>
#undef protected
#include "koprefsdialog.h"
#include <kapplication.h>
#include <libkdepim/externalapphandler.h>
#include <libkdepim/kpimglobalprefs.h>
#ifdef MINIKDE_KDIALOG_H
@@ -24,13 +29,13 @@
#include "accountview.h"
#include "klocale.h"
#include <qmessagebox.h>
#include <qtimer.h>
#include <qcursor.h>
-#include <qtextbrowser.h>
+#include <q3textbrowser.h>
#include <qregexp.h>
#include <qpe/global.h>
#ifdef DESKTOP_VERSION
#include <qapplication.h>
#else
@@ -60,18 +65,18 @@ OpieMail::~OpieMail()
{
if (settings) delete settings;
if ( tb )
delete tb;
}
-void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
+void OpieMail::appMessage(const Q3CString &msg, const QByteArray &data)
{
}
#include <stdlib.h>
-void OpieMail::message(const QCString &msg, const QByteArray &data)
+void OpieMail::message(const Q3CString &msg, const QByteArray &data)
{
// copied from old mail2
static int ii = 0;
//qDebug("QCOP CALL ############################# %d ", ii);
//QString mess ( msg );
//qDebug("Message = %s ",mess.latin1());
@@ -80,13 +85,13 @@ void OpieMail::message(const QCString &msg, const QByteArray &data)
mPendingEmail = QString::null;
mPendingName = QString::null;
if (msg == "writeMail(QString,QString)")
{
//qDebug("writeMail(QString,QString) ");
- QDataStream stream(data,IO_ReadOnly);
+ QDataStream stream(data,QIODevice::ReadOnly);
stream >> mPendingName >> mPendingEmail;
// removing the whitespaces at beginning and end is needed!
QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
}
else if (msg == "newMail()")
{
@@ -97,13 +102,13 @@ void OpieMail::message(const QCString &msg, const QByteArray &data)
QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
// slotComposeMail();
}
else if (msg == "newMail(QString)")
{
//qDebug(" newMail(QString)");
- QDataStream stream(data,IO_ReadOnly);
+ QDataStream stream(data,QIODevice::ReadOnly);
stream >> mPendingName;
// the format is
// NAME <EMAIL>:SUBJECT
QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
} else {
mPendingData = data;
@@ -276,13 +281,13 @@ void OpieMail::slotEditAccounts()
folderView->populate( settings->getAccounts() );
}
void OpieMail::replyMail()
{
- QListViewItem*item = mailView->currentItem();
+ Q3ListViewItem*item = mailView->currentItem();
if (!item) return;
RecMailP mail = ((MailListViewItem*)item)->data();
RecBodyP body = folderView->fetchBody(mail);
QString rtext;
rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
@@ -328,13 +333,13 @@ void OpieMail::closeViewMail(ViewMail * vm)
{
vm->hide();
}
void OpieMail::slotDownloadMail( )
{
- QListViewItem*item = mailView->currentItem();
+ Q3ListViewItem*item = mailView->currentItem();
if (!item ) {
Global::statusMessage("Error: No item slected!");
return;
}
RecMailP mail = ((MailListViewItem*)item)->data();
Account * acc = mail->Wrapper()->getAccount();
@@ -369,13 +374,13 @@ void OpieMail::slotDownloadMail( )
}
}
void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
{
- QListViewItem*item = mailView->currentItem();
+ Q3ListViewItem*item = mailView->currentItem();
if (!item ) {
closeViewMail(vm);
return;
}
RecMailP mail = ((MailListViewItem*)item)->data();
mail->Wrapper()->deleteMail( mail );
@@ -389,13 +394,13 @@ void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
RecBodyP body = folderView->fetchBody(mail);
vm->setBody( body );
vm->setMail( mail );
}
void OpieMail::displayNextMail(ViewMail * vm)
{
- QListViewItem*item = mailView->currentItem();
+ Q3ListViewItem*item = mailView->currentItem();
if (!item) return;
( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
item = item->itemBelow();
if (!item) {
vm->setCaption(i18n("End of List" ));
return;
@@ -405,13 +410,13 @@ void OpieMail::displayNextMail(ViewMail * vm)
RecBodyP body = folderView->fetchBody(mail);
vm->setBody( body );
vm->setMail( mail );
}
void OpieMail::displayMail()
{
- QListViewItem*item = mailView->currentItem();
+ Q3ListViewItem*item = mailView->currentItem();
if (!item) return;
RecMailP mail = ((MailListViewItem*)item)->data();
RecBodyP body = folderView->fetchBody(mail);
ViewMail readMail( this,"", Qt::WType_Modal );
readMail.setBody( body );
readMail.setMail( mail );
@@ -429,28 +434,28 @@ void OpieMail::displayMail()
if ( readMail.deleted )
{
folderView->refreshCurrent();
}
else
{
- QListViewItem*item = mailView->currentItem();
+ Q3ListViewItem*item = mailView->currentItem();
if (item)
( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
}
}
void OpieMail::slotGetAllMail()
{
- QListViewItem * item = folderView->firstChild();
+ Q3ListViewItem * item = folderView->firstChild();
while ( item ){
((AccountViewItem *)item)->contextMenuSelected( 101 );
item = item->nextSibling ();
}
}
void OpieMail::slotGetMail()
{
- QListViewItem * item = folderView->currentItem();
+ Q3ListViewItem * item = folderView->currentItem();
if ( ! item ) return;
((AccountViewItem *)item)->contextMenuSelected( 101 );
}
void OpieMail::slotDeleteMail()
{
if (!mailView->currentItem()) return;
@@ -461,13 +466,13 @@ void OpieMail::slotDeleteMail()
folderView->refreshCurrent();
}
}
void OpieMail::slotDeleteAllMail()
{
- QValueList<RecMailP> t;
+ Q3ValueList<RecMailP> t;
if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
{
MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
while ( item ) {
if ( item->isSelected() ) {
t.append( item->data() );
@@ -489,27 +494,27 @@ void OpieMail::clearSelection()
{
mailView->clearSelection();
}
void OpieMail::selectAll()
{
- QListViewItem* item = mailView->firstChild ();
+ Q3ListViewItem* item = mailView->firstChild ();
while ( item ) {
mailView->setSelected ( item, true );
item = item->nextSibling();
}
}
-void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
+void OpieMail::mailHold(int button, Q3ListViewItem *item,const QPoint&,int )
{
if (!mailView->currentItem()) return;
MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType();
/* just the RIGHT button - or hold on pda */
if (button!=2) {return;}
if (!item) return;
- QPopupMenu *m = new QPopupMenu(0);
+ Q3PopupMenu *m = new Q3PopupMenu(0);
if (m)
{
if (mailtype==MAILLIB::A_NNTP) {
m->insertItem(i18n("Read this posting"),this,SLOT(displayMail()));
m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail()));
m->insertSeparator();
@@ -550,28 +555,28 @@ void OpieMail::slotShowFolders( bool show )
slotAdjustColumnsWide();
folderView->hide();
//slotAdjustColumnsWide();
}
}
-void OpieMail::refreshMailView(const QValueList<RecMailP>&list)
+void OpieMail::refreshMailView(const Q3ValueList<RecMailP>&list)
{
MailListViewItem*item = 0;
mailView->clear();
- QValueList<RecMailP>::ConstIterator it;
+ Q3ValueList<RecMailP>::ConstIterator it;
for (it = list.begin(); it != list.end();++it)
{
item = new MailListViewItem(mailView,item);
item->storeData((*it));
item->showEntry();
}
mailView->setSorting ( 4, false );
}
-void OpieMail::mailLeftClicked( QListViewItem *item )
+void OpieMail::mailLeftClicked( Q3ListViewItem *item )
{
mailView->clearSelection();
/* just LEFT button - or tap with stylus on pda */
//if (button!=1) return;
if (!item) return;
if (folderView->currentisDraft()) {
@@ -611,13 +616,13 @@ void OpieMail::slotMoveCopyMail()
}
void OpieMail::slotMoveCopyAllMail()
{
if (!mailView->currentItem()) return;
- QValueList<RecMailP> t;
+ Q3ValueList<RecMailP> t;
// if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
{
MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
while ( item ) {
if ( item->isSelected() ) {
t.append( item->data() );