author | zautrix <zautrix> | 2004-10-27 22:35:41 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-27 22:35:41 (UTC) |
commit | 5afbc6ae0908ce12fd5abb1c4eadf9c61a01503c (patch) (unidiff) | |
tree | 914ce70d7e5a1afcd2da0c2fda34b959d65d0462 /libkdepim/externalapphandler.cpp | |
parent | 9c88346fc757fd1dc54b3fca151a2a610159d8cf (diff) | |
download | kdepimpi-5afbc6ae0908ce12fd5abb1c4eadf9c61a01503c.zip kdepimpi-5afbc6ae0908ce12fd5abb1c4eadf9c61a01503c.tar.gz kdepimpi-5afbc6ae0908ce12fd5abb1c4eadf9c61a01503c.tar.bz2 |
pwm close fix
Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/externalapphandler.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 9085673..9f12152 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp | |||
@@ -1023,159 +1023,165 @@ bool ExternalAppHandler::callBySIP( const QString& sipnumber ) | |||
1023 | 1023 | ||
1024 | 1024 | ||
1025 | //first check if one of the sip apps need the emails right in the message. | 1025 | //first check if one of the sip apps need the emails right in the message. |
1026 | message = translateMessage(message, sipnumber, ""); | 1026 | message = translateMessage(message, sipnumber, ""); |
1027 | 1027 | ||
1028 | 1028 | ||
1029 | #ifdef DEBUG_EXT_APP_HANDLER | 1029 | #ifdef DEBUG_EXT_APP_HANDLER |
1030 | qDebug("10Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); | 1030 | qDebug("10Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); |
1031 | qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1()); | 1031 | qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1()); |
1032 | #endif | 1032 | #endif |
1033 | 1033 | ||
1034 | QCopEnvelope e(channel.latin1(), message.latin1()); | 1034 | QCopEnvelope e(channel.latin1(), message.latin1()); |
1035 | //US we need no names in the To field. The emailadresses are enough | 1035 | //US we need no names in the To field. The emailadresses are enough |
1036 | 1036 | ||
1037 | passParameters(&e, parameters, sipnumber, ""); | 1037 | passParameters(&e, parameters, sipnumber, ""); |
1038 | 1038 | ||
1039 | 1039 | ||
1040 | #else | 1040 | #else |
1041 | KMessageBox::sorry( 0, i18n( "This version does not support sip." ) ); | 1041 | KMessageBox::sorry( 0, i18n( "This version does not support sip." ) ); |
1042 | #endif | 1042 | #endif |
1043 | 1043 | ||
1044 | 1044 | ||
1045 | return true; | 1045 | return true; |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | 1048 | ||
1049 | /************************************************************************** | 1049 | /************************************************************************** |
1050 | * | 1050 | * |
1051 | **************************************************************************/ | 1051 | **************************************************************************/ |
1052 | 1052 | ||
1053 | 1053 | ||
1054 | QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1, const QString& param2 ) const | 1054 | QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1, const QString& param2 ) const |
1055 | { | 1055 | { |
1056 | message = message.replace( QRegExp("%1"), param1 ); | 1056 | message = message.replace( QRegExp("%1"), param1 ); |
1057 | return message.replace( QRegExp("%2"), param2 ); | 1057 | return message.replace( QRegExp("%2"), param2 ); |
1058 | } | 1058 | } |
1059 | 1059 | ||
1060 | /************************************************************************** | 1060 | /************************************************************************** |
1061 | * | 1061 | * |
1062 | **************************************************************************/ | 1062 | **************************************************************************/ |
1063 | 1063 | ||
1064 | void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1 , const QString& param2) const | 1064 | void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1 , const QString& param2) const |
1065 | { | 1065 | { |
1066 | #ifndef DESKTOP_VERSION | 1066 | #ifndef DESKTOP_VERSION |
1067 | QMap<QString, QString> valmap; | 1067 | QMap<QString, QString> valmap; |
1068 | bool useValMap = false; | 1068 | bool useValMap = false; |
1069 | 1069 | ||
1070 | // first extract all parts of the parameters. | 1070 | // first extract all parts of the parameters. |
1071 | QStringList paramlist = QStringList::split(";", parameters); | 1071 | QStringList paramlist = QStringList::split(";", parameters); |
1072 | 1072 | ||
1073 | //Now check how many parts we have. | 1073 | //Now check how many parts we have. |
1074 | //=0 :no params to pass | 1074 | //=0 :no params to pass |
1075 | //>0 :parameters to pass | 1075 | //>0 :parameters to pass |
1076 | for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it ) | 1076 | for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it ) |
1077 | { | 1077 | { |
1078 | QString param = (*it); | 1078 | QString param = (*it); |
1079 | QStringList keyvallist = QStringList::split("=", param); | 1079 | QStringList keyvallist = QStringList::split("=", param); |
1080 | 1080 | ||
1081 | //if we have keyvalue pairs, we assume that we pass a map to the envelope | 1081 | //if we have keyvalue pairs, we assume that we pass a map to the envelope |
1082 | QStringList::Iterator it2 = keyvallist.begin(); | 1082 | QStringList::Iterator it2 = keyvallist.begin(); |
1083 | QString key = (*it2); | 1083 | QString key = (*it2); |
1084 | key = key.replace( QRegExp("%1"), param1 ); | 1084 | key = key.replace( QRegExp("%1"), param1 ); |
1085 | key = key.replace( QRegExp("%2"), param2 ); | 1085 | key = key.replace( QRegExp("%2"), param2 ); |
1086 | ++it2; | 1086 | ++it2; |
1087 | 1087 | ||
1088 | if(it2 != keyvallist.end()) | 1088 | if(it2 != keyvallist.end()) |
1089 | { | 1089 | { |
1090 | QString value = (*it2); | 1090 | QString value = (*it2); |
1091 | value = value.replace( QRegExp("%1"), param1 ); | 1091 | value = value.replace( QRegExp("%1"), param1 ); |
1092 | value = value.replace( QRegExp("%2"), param2 ); | 1092 | value = value.replace( QRegExp("%2"), param2 ); |
1093 | 1093 | ||
1094 | valmap.insert(key, value); | 1094 | valmap.insert(key, value); |
1095 | useValMap = true; | 1095 | useValMap = true; |
1096 | } | 1096 | } |
1097 | else | 1097 | else |
1098 | { | 1098 | { |
1099 | // qDebug("pass parameter << %s", key.latin1()); | 1099 | // qDebug("pass parameter << %s", key.latin1()); |
1100 | (*e) << key; | 1100 | (*e) << key; |
1101 | } | 1101 | } |
1102 | } | 1102 | } |
1103 | 1103 | ||
1104 | if (useValMap == true) | 1104 | if (useValMap == true) |
1105 | (*e) << valmap; | 1105 | (*e) << valmap; |
1106 | 1106 | ||
1107 | #endif | 1107 | #endif |
1108 | 1108 | ||
1109 | } | 1109 | } |
1110 | 1110 | ||
1111 | 1111 | ||
1112 | 1112 | ||
1113 | /************************************************************************** | 1113 | /************************************************************************** |
1114 | * | 1114 | * |
1115 | **************************************************************************/ | 1115 | **************************************************************************/ |
1116 | 1116 | ||
1117 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) | 1117 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) |
1118 | { | 1118 | { |
1119 | |||
1120 | if ( cmsg == "nextView()" ) { | ||
1121 | emit nextView(); | ||
1122 | return; | ||
1123 | } | ||
1124 | |||
1119 | bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); | 1125 | bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); |
1120 | if (!res) | 1126 | if (!res) |
1121 | res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); | 1127 | res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); |
1122 | 1128 | ||
1123 | if (!res) | 1129 | if (!res) |
1124 | res = mDisplayDetails->appMessage( cmsg, data ); | 1130 | res = mDisplayDetails->appMessage( cmsg, data ); |
1125 | 1131 | ||
1126 | // if (!res) | 1132 | // if (!res) |
1127 | // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); | 1133 | // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); |
1128 | } | 1134 | } |
1129 | 1135 | ||
1130 | 1136 | ||
1131 | 1137 | ||
1132 | bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) | 1138 | bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) |
1133 | { | 1139 | { |
1134 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); | 1140 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); |
1135 | return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); | 1141 | return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); |
1136 | } | 1142 | } |
1137 | 1143 | ||
1138 | bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) | 1144 | bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) |
1139 | { | 1145 | { |
1140 | QStringList list4, list5, list6; | 1146 | QStringList list4, list5, list6; |
1141 | 1147 | ||
1142 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); | 1148 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); |
1143 | return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1149 | return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1144 | } | 1150 | } |
1145 | 1151 | ||
1146 | bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) | 1152 | bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) |
1147 | { | 1153 | { |
1148 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); | 1154 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); |
1149 | return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); | 1155 | return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); |
1150 | } | 1156 | } |
1151 | 1157 | ||
1152 | bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) | 1158 | bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) |
1153 | { | 1159 | { |
1154 | QStringList list4, list5, list6; | 1160 | QStringList list4, list5, list6; |
1155 | 1161 | ||
1156 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); | 1162 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); |
1157 | return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1163 | return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1158 | } | 1164 | } |
1159 | 1165 | ||
1160 | bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid) | 1166 | bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid) |
1161 | { | 1167 | { |
1162 | mDisplayDetails->setSourceChannel(""); | 1168 | mDisplayDetails->setSourceChannel(""); |
1163 | return mDisplayDetails->sendMessageToTarget("", name, email, uid); | 1169 | return mDisplayDetails->sendMessageToTarget("", name, email, uid); |
1164 | } | 1170 | } |
1165 | 1171 | ||
1166 | bool ExternalAppHandler::requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid) | 1172 | bool ExternalAppHandler::requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid) |
1167 | { | 1173 | { |
1168 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); | 1174 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); |
1169 | return mBirthdayListFromKAPITransfer->sendMessageToTarget(sessionuid); | 1175 | return mBirthdayListFromKAPITransfer->sendMessageToTarget(sessionuid); |
1170 | } | 1176 | } |
1171 | 1177 | ||
1172 | bool ExternalAppHandler::returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6) | 1178 | bool ExternalAppHandler::returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6) |
1173 | { | 1179 | { |
1174 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); | 1180 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); |
1175 | return mBirthdayListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1181 | return mBirthdayListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1176 | } | 1182 | } |
1177 | 1183 | ||
1178 | 1184 | ||
1179 | 1185 | ||
1180 | 1186 | ||
1181 | 1187 | ||