author | zautrix <zautrix> | 2005-03-29 14:23:43 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-29 14:23:43 (UTC) |
commit | 3116f249fc6ccd0e067213e826d3d924f6986972 (patch) (unidiff) | |
tree | fe37b19450279d07b6767d56ef0deeff51f7485e /libkdepim/externalapphandler.cpp | |
parent | c873163eca527625ce22ed461ee5d4fec61b3b18 (diff) | |
download | kdepimpi-3116f249fc6ccd0e067213e826d3d924f6986972.zip kdepimpi-3116f249fc6ccd0e067213e826d3d924f6986972.tar.gz kdepimpi-3116f249fc6ccd0e067213e826d3d924f6986972.tar.bz2 |
fix
Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/externalapphandler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 7200da9..f8f4c8a 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp | |||
@@ -1059,143 +1059,146 @@ bool ExternalAppHandler::callBySIP( const QString& sipnumber ) | |||
1059 | } | 1059 | } |
1060 | 1060 | ||
1061 | 1061 | ||
1062 | /************************************************************************** | 1062 | /************************************************************************** |
1063 | * | 1063 | * |
1064 | **************************************************************************/ | 1064 | **************************************************************************/ |
1065 | 1065 | ||
1066 | 1066 | ||
1067 | QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1, const QString& param2 ) const | 1067 | QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1, const QString& param2 ) const |
1068 | { | 1068 | { |
1069 | message = message.replace( QRegExp("%1"), param1 ); | 1069 | message = message.replace( QRegExp("%1"), param1 ); |
1070 | return message.replace( QRegExp("%2"), param2 ); | 1070 | return message.replace( QRegExp("%2"), param2 ); |
1071 | } | 1071 | } |
1072 | 1072 | ||
1073 | /************************************************************************** | 1073 | /************************************************************************** |
1074 | * | 1074 | * |
1075 | **************************************************************************/ | 1075 | **************************************************************************/ |
1076 | 1076 | ||
1077 | void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1 , const QString& param2) const | 1077 | void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1 , const QString& param2) const |
1078 | { | 1078 | { |
1079 | #ifndef DESKTOP_VERSION | 1079 | #ifndef DESKTOP_VERSION |
1080 | QMap<QString, QString> valmap; | 1080 | QMap<QString, QString> valmap; |
1081 | bool useValMap = false; | 1081 | bool useValMap = false; |
1082 | 1082 | ||
1083 | // first extract all parts of the parameters. | 1083 | // first extract all parts of the parameters. |
1084 | QStringList paramlist = QStringList::split(";", parameters); | 1084 | QStringList paramlist = QStringList::split(";", parameters); |
1085 | 1085 | ||
1086 | //Now check how many parts we have. | 1086 | //Now check how many parts we have. |
1087 | //=0 :no params to pass | 1087 | //=0 :no params to pass |
1088 | //>0 :parameters to pass | 1088 | //>0 :parameters to pass |
1089 | for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it ) | 1089 | for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it ) |
1090 | { | 1090 | { |
1091 | QString param = (*it); | 1091 | QString param = (*it); |
1092 | QStringList keyvallist = QStringList::split("=", param); | 1092 | QStringList keyvallist = QStringList::split("=", param); |
1093 | 1093 | ||
1094 | //if we have keyvalue pairs, we assume that we pass a map to the envelope | 1094 | //if we have keyvalue pairs, we assume that we pass a map to the envelope |
1095 | QStringList::Iterator it2 = keyvallist.begin(); | 1095 | QStringList::Iterator it2 = keyvallist.begin(); |
1096 | QString key = (*it2); | 1096 | QString key = (*it2); |
1097 | key = key.replace( QRegExp("%1"), param1 ); | 1097 | key = key.replace( QRegExp("%1"), param1 ); |
1098 | key = key.replace( QRegExp("%2"), param2 ); | 1098 | key = key.replace( QRegExp("%2"), param2 ); |
1099 | ++it2; | 1099 | ++it2; |
1100 | 1100 | ||
1101 | if(it2 != keyvallist.end()) | 1101 | if(it2 != keyvallist.end()) |
1102 | { | 1102 | { |
1103 | QString value = (*it2); | 1103 | QString value = (*it2); |
1104 | value = value.replace( QRegExp("%1"), param1 ); | 1104 | value = value.replace( QRegExp("%1"), param1 ); |
1105 | value = value.replace( QRegExp("%2"), param2 ); | 1105 | value = value.replace( QRegExp("%2"), param2 ); |
1106 | 1106 | ||
1107 | valmap.insert(key, value); | 1107 | valmap.insert(key, value); |
1108 | useValMap = true; | 1108 | useValMap = true; |
1109 | } | 1109 | } |
1110 | else | 1110 | else |
1111 | { | 1111 | { |
1112 | // qDebug("pass parameter << %s", key.latin1()); | 1112 | // qDebug("pass parameter << %s", key.latin1()); |
1113 | (*e) << key; | 1113 | (*e) << key; |
1114 | } | 1114 | } |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | if (useValMap == true) | 1117 | if (useValMap == true) |
1118 | (*e) << valmap; | 1118 | (*e) << valmap; |
1119 | 1119 | ||
1120 | #endif | 1120 | #endif |
1121 | 1121 | ||
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | 1124 | ||
1125 | 1125 | ||
1126 | /************************************************************************** | 1126 | /************************************************************************** |
1127 | * | 1127 | * |
1128 | **************************************************************************/ | 1128 | **************************************************************************/ |
1129 | 1129 | ||
1130 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) | 1130 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) |
1131 | { | 1131 | { |
1132 | 1132 | ||
1133 | if ( cmsg == "nextView()" ) { | 1133 | if ( cmsg == "nextView()" ) { |
1134 | qDebug("nextView()"); | 1134 | qDebug("nextView()"); |
1135 | emit nextView(); | 1135 | emit nextView(); |
1136 | return; | 1136 | return; |
1137 | } | 1137 | } |
1138 | 1138 | ||
1139 | bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); | 1139 | bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); |
1140 | if (!res) | 1140 | if (!res) |
1141 | res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); | 1141 | res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); |
1142 | 1142 | ||
1143 | if (!res) | 1143 | if (!res) |
1144 | res = mDisplayDetails->appMessage( cmsg, data ); | 1144 | res = mDisplayDetails->appMessage( cmsg, data ); |
1145 | 1145 | ||
1146 | // if (!res) | 1146 | // if (!res) |
1147 | // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); | 1147 | // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); |
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | 1150 | ||
1151 | 1151 | ||
1152 | bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) | 1152 | bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) |
1153 | { | 1153 | { |
1154 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); | 1154 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); |
1155 | return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); | 1155 | // maybe we are sending to KA/Pi fom a different worldd... |
1156 | // it may be that the QAplication::desktop()->width() values in KA/Pi are not the same as in our application | ||
1157 | // for that reason we send the current QApplication::desktop()->width() to KA/Pi | ||
1158 | return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(QString::number ( QApplication::desktop()->width() )); | ||
1156 | } | 1159 | } |
1157 | 1160 | ||
1158 | bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) | 1161 | bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) |
1159 | { | 1162 | { |
1160 | QStringList list4, list5, list6; | 1163 | QStringList list4, list5, list6; |
1161 | 1164 | ||
1162 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); | 1165 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); |
1163 | return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1166 | return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1164 | } | 1167 | } |
1165 | 1168 | ||
1166 | bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) | 1169 | bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) |
1167 | { | 1170 | { |
1168 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); | 1171 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); |
1169 | return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); | 1172 | return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); |
1170 | } | 1173 | } |
1171 | 1174 | ||
1172 | bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) | 1175 | bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) |
1173 | { | 1176 | { |
1174 | QStringList list4, list5, list6; | 1177 | QStringList list4, list5, list6; |
1175 | 1178 | ||
1176 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); | 1179 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); |
1177 | return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1180 | return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1178 | } | 1181 | } |
1179 | 1182 | ||
1180 | bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid) | 1183 | bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid) |
1181 | { | 1184 | { |
1182 | mDisplayDetails->setSourceChannel(""); | 1185 | mDisplayDetails->setSourceChannel(""); |
1183 | return mDisplayDetails->sendMessageToTarget("", name, email, uid); | 1186 | return mDisplayDetails->sendMessageToTarget("", name, email, uid); |
1184 | } | 1187 | } |
1185 | 1188 | ||
1186 | bool ExternalAppHandler::requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid) | 1189 | bool ExternalAppHandler::requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid) |
1187 | { | 1190 | { |
1188 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); | 1191 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); |
1189 | return mBirthdayListFromKAPITransfer->sendMessageToTarget(sessionuid); | 1192 | return mBirthdayListFromKAPITransfer->sendMessageToTarget(sessionuid); |
1190 | } | 1193 | } |
1191 | 1194 | ||
1192 | 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) | 1195 | 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) |
1193 | { | 1196 | { |
1194 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); | 1197 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); |
1195 | return mBirthdayListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1198 | return mBirthdayListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1196 | } | 1199 | } |
1197 | 1200 | ||
1198 | 1201 | ||
1199 | 1202 | ||
1200 | 1203 | ||
1201 | 1204 | ||