Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (ignore 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 | |||
@@ -38,9 +38,11 @@ $Id$ | |||
38 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
39 | #include <qtopia/qcopenvelope_qws.h> | 39 | #include <qtopia/qcopenvelope_qws.h> |
40 | #else | 40 | #else |
41 | #include <qapplication.h> | 41 | #include <qapplication.h> |
42 | #include <qprocess.h> | 42 | #include <q3process.h> |
43 | //Added by qt3to4: | ||
44 | #include <Q3CString> | ||
43 | #endif | 45 | #endif |
44 | 46 | ||
45 | #include <kstaticdeleter.h> | 47 | #include <kstaticdeleter.h> |
46 | #include <kmessagebox.h> | 48 | #include <kmessagebox.h> |
@@ -122,9 +124,9 @@ void QCopTransferItem::setSourceChannel(const QString& sourceChannel) | |||
122 | } | 124 | } |
123 | 125 | ||
124 | 126 | ||
125 | /*********************************************************************************/ | 127 | /*********************************************************************************/ |
126 | bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) | 128 | bool QCopTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) |
127 | { | 129 | { |
128 | 130 | ||
129 | // copied from old mail2 | 131 | // copied from old mail2 |
130 | /* | 132 | /* |
@@ -145,9 +147,9 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data | |||
145 | //we are in the target and get a request from the source | 147 | //we are in the target and get a request from the source |
146 | if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data()) | 148 | if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data()) |
147 | { | 149 | { |
148 | 150 | ||
149 | QDataStream stream( data, IO_ReadOnly ); | 151 | QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); |
150 | 152 | ||
151 | 153 | ||
152 | QString sourceChannel; | 154 | QString sourceChannel; |
153 | QString uid; | 155 | QString uid; |
@@ -225,15 +227,15 @@ bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QSt | |||
225 | } | 227 | } |
226 | 228 | ||
227 | 229 | ||
228 | /*********************************************************************************/ | 230 | /*********************************************************************************/ |
229 | bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) | 231 | bool QCopMapTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) |
230 | { | 232 | { |
231 | bool res = QCopTransferItem::appMessage( cmsg, data ); | 233 | bool res = QCopTransferItem::appMessage( cmsg, data ); |
232 | 234 | ||
233 | if (res == false) | 235 | if (res == false) |
234 | { | 236 | { |
235 | QDataStream stream( data, IO_ReadOnly ); | 237 | QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); |
236 | 238 | ||
237 | // qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); | 239 | // qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); |
238 | 240 | ||
239 | //we are in the source and get an answer from the target | 241 | //we are in the source and get an answer from the target |
@@ -304,18 +306,18 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString | |||
304 | } | 306 | } |
305 | 307 | ||
306 | 308 | ||
307 | /*********************************************************************************/ | 309 | /*********************************************************************************/ |
308 | bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) | 310 | bool QCopListTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) |
309 | { | 311 | { |
310 | bool res = QCopTransferItem::appMessage( cmsg, data ); | 312 | bool res = QCopTransferItem::appMessage( cmsg, data ); |
311 | #ifdef DEBUG_EXT_APP_HANDLER | 313 | #ifdef DEBUG_EXT_APP_HANDLER |
312 | qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); | 314 | qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); |
313 | #endif | 315 | #endif |
314 | 316 | ||
315 | if (res == false) | 317 | if (res == false) |
316 | { | 318 | { |
317 | QDataStream stream( data, IO_ReadOnly ); | 319 | QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); |
318 | 320 | ||
319 | #ifdef DEBUG_EXT_APP_HANDLER | 321 | #ifdef DEBUG_EXT_APP_HANDLER |
320 | qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); | 322 | qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); |
321 | #endif | 323 | #endif |
@@ -517,11 +519,11 @@ void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& la | |||
517 | mDefaultItems.append(dai); | 519 | mDefaultItems.append(dai); |
518 | } | 520 | } |
519 | 521 | ||
520 | 522 | ||
521 | QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) | 523 | Q3PtrList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) |
522 | { | 524 | { |
523 | QList<DefaultAppItem> list; | 525 | Q3PtrList<DefaultAppItem> list; |
524 | 526 | ||
525 | DefaultAppItem* dai; | 527 | DefaultAppItem* dai; |
526 | 528 | ||
527 | for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) | 529 | for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) |
@@ -745,9 +747,9 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS | |||
745 | qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1()); | 747 | qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1()); |
746 | #endif | 748 | #endif |
747 | qDebug("%s --- %s %s --- %s %s", channel.latin1(), message.latin1(),message2.latin1(), parameters.latin1(), parameters2.latin1() ); | 749 | qDebug("%s --- %s %s --- %s %s", channel.latin1(), message.latin1(),message2.latin1(), parameters.latin1(), parameters2.latin1() ); |
748 | //KMessageBox::sorry( 0, message2 ); | 750 | //KMessageBox::sorry( 0, message2 ); |
749 | QProcess * proc = new QProcess( this ); | 751 | Q3Process * proc = new Q3Process( this ); |
750 | int i = 0; | 752 | int i = 0; |
751 | proc->addArgument( channel ); | 753 | proc->addArgument( channel ); |
752 | 754 | ||
753 | if ( message.find (" " ) > 0 ) { | 755 | if ( message.find (" " ) > 0 ) { |
@@ -771,9 +773,9 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS | |||
771 | 773 | ||
772 | //KMessageBox::sorry( 0,arg ); | 774 | //KMessageBox::sorry( 0,arg ); |
773 | //qDebug("2add%sdd ",arg.latin1() ); | 775 | //qDebug("2add%sdd ",arg.latin1() ); |
774 | proc->addArgument( arg); | 776 | proc->addArgument( arg); |
775 | proc->launch(""); | 777 | proc->launch(QString()); |
776 | #endif | 778 | #endif |
777 | 779 | ||
778 | return true; | 780 | return true; |
779 | } | 781 | } |
@@ -830,9 +832,9 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e | |||
830 | passParameters(&e, parameters, name, emailadress); | 832 | passParameters(&e, parameters, name, emailadress); |
831 | #else // DESKTOP_VERSION | 833 | #else // DESKTOP_VERSION |
832 | 834 | ||
833 | //KMessageBox::sorry( 0,channel ); | 835 | //KMessageBox::sorry( 0,channel ); |
834 | QProcess * proc = new QProcess( this ); | 836 | Q3Process * proc = new Q3Process( this ); |
835 | proc->addArgument( channel ); | 837 | proc->addArgument( channel ); |
836 | if ( message.find (" " ) > 0 ) { | 838 | if ( message.find (" " ) > 0 ) { |
837 | QStringList list = QStringList::split( " ", message ); | 839 | QStringList list = QStringList::split( " ", message ); |
838 | int i = 0; | 840 | int i = 0; |
@@ -849,9 +851,9 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e | |||
849 | parameters = translateMessage(parameters, name, emailadress); | 851 | parameters = translateMessage(parameters, name, emailadress); |
850 | 852 | ||
851 | //KMessageBox::information(0,parameters); | 853 | //KMessageBox::information(0,parameters); |
852 | proc->addArgument( parameters ); | 854 | proc->addArgument( parameters ); |
853 | proc->launch(""); | 855 | proc->launch(QString()); |
854 | #endif | 856 | #endif |
855 | 857 | ||
856 | return true; | 858 | return true; |
857 | } | 859 | } |
@@ -1231,9 +1233,9 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete | |||
1231 | /************************************************************************** | 1233 | /************************************************************************** |
1232 | * | 1234 | * |
1233 | **************************************************************************/ | 1235 | **************************************************************************/ |
1234 | 1236 | ||
1235 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) | 1237 | void ExternalAppHandler::appMessage( const Q3CString& cmsg, const QByteArray& data ) |
1236 | { | 1238 | { |
1237 | qDebug("ExternalAppHandler::appMessage %s %x", cmsg.data(), this); | 1239 | qDebug("ExternalAppHandler::appMessage %s %x", cmsg.data(), this); |
1238 | if ( cmsg == "nextView()" ) { | 1240 | if ( cmsg == "nextView()" ) { |
1239 | qDebug("nextView()"); | 1241 | qDebug("nextView()"); |