Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libkdepim/externalapphandler.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index f376e6c..3fc548a 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp @@ -36,13 +36,15 @@ $Id$ #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #include <qtopia/qcopenvelope_qws.h> #else #include <qapplication.h> -#include <qprocess.h> +#include <q3process.h> +//Added by qt3to4: +#include <Q3CString> #endif #include <kstaticdeleter.h> #include <kmessagebox.h> @@ -120,13 +122,13 @@ void QCopTransferItem::setSourceChannel(const QString& sourceChannel) if ( !sourceChannel.isEmpty()) _sourceChannel = sourceChannel; } /*********************************************************************************/ -bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) +bool QCopTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) { // copied from old mail2 /* static int ii = 0; @@ -143,13 +145,13 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data // qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() ); //we are in the target and get a request from the source if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data()) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); QString sourceChannel; QString uid; QString param1; QString param2; @@ -223,19 +225,19 @@ bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QSt #endif } /*********************************************************************************/ -bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) +bool QCopMapTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) { bool res = QCopTransferItem::appMessage( cmsg, data ); if (res == false) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); // qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); //we are in the source and get an answer from the target if ((_targetMessage + _targetMessageParameters) == cmsg.data()) { @@ -302,22 +304,22 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString #endif } /*********************************************************************************/ -bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) +bool QCopListTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) { bool res = QCopTransferItem::appMessage( cmsg, data ); #ifdef DEBUG_EXT_APP_HANDLER qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); #endif if (res == false) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); #ifdef DEBUG_EXT_APP_HANDLER qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); #endif //we are in the source and get an answer from the target @@ -515,15 +517,15 @@ void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& la DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2); // qDebug("%d %d %s %s ", type, id, label.latin1(), channel.latin1() ); mDefaultItems.append(dai); } -QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) +Q3PtrList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) { - QList<DefaultAppItem> list; + Q3PtrList<DefaultAppItem> list; DefaultAppItem* dai; for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) { if (dai->_type == type) @@ -743,13 +745,13 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS #ifdef DEBUG_EXT_APP_HANDLER qDebug("4Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1()); qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1()); #endif qDebug("%s --- %s %s --- %s %s", channel.latin1(), message.latin1(),message2.latin1(), parameters.latin1(), parameters2.latin1() ); //KMessageBox::sorry( 0, message2 ); - QProcess * proc = new QProcess( this ); + Q3Process * proc = new Q3Process( this ); int i = 0; proc->addArgument( channel ); if ( message.find (" " ) > 0 ) { QStringList list = QStringList::split( " ", message ); int i = 0; @@ -769,13 +771,13 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS QString arg = "to='%1'"; arg = arg.arg( emails ) + ","+parameters2;; //KMessageBox::sorry( 0,arg ); //qDebug("2add%sdd ",arg.latin1() ); proc->addArgument( arg); - proc->launch(""); + proc->launch(QString()); #endif return true; } /************************************************************************** @@ -828,13 +830,13 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e //US we need no names in the To field. The emailadresses are enough passParameters(&e, parameters, name, emailadress); #else // DESKTOP_VERSION //KMessageBox::sorry( 0,channel ); - QProcess * proc = new QProcess( this ); + Q3Process * proc = new Q3Process( this ); proc->addArgument( channel ); if ( message.find (" " ) > 0 ) { QStringList list = QStringList::split( " ", message ); int i = 0; while ( i < list.count ( ) ) { //qDebug("add%sdd ",list[i].latin1() ); @@ -847,13 +849,13 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e } parameters = translateMessage(parameters, name, emailadress); //KMessageBox::information(0,parameters); proc->addArgument( parameters ); - proc->launch(""); + proc->launch(QString()); #endif return true; } /************************************************************************** @@ -1229,13 +1231,13 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete /************************************************************************** * **************************************************************************/ -void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) +void ExternalAppHandler::appMessage( const Q3CString& cmsg, const QByteArray& data ) { qDebug("ExternalAppHandler::appMessage %s %x", cmsg.data(), this); if ( cmsg == "nextView()" ) { qDebug("nextView()"); QTimer::singleShot( 0, this, SIGNAL ( nextView() )); return; |