author | zautrix <zautrix> | 2006-02-24 18:49:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2006-02-24 18:49:56 (UTC) |
commit | d7738fdfc685192eb2f8317db6ffad3c246001c8 (patch) (unidiff) | |
tree | d9aae6ca97851fd1b53c4d9e74740a5ee2b69ea9 /libkdepim/externalapphandler.cpp | |
parent | 987757f168bbae56100f2aff763b865e81ceec18 (diff) | |
download | kdepimpi-d7738fdfc685192eb2f8317db6ffad3c246001c8.zip kdepimpi-d7738fdfc685192eb2f8317db6ffad3c246001c8.tar.gz kdepimpi-d7738fdfc685192eb2f8317db6ffad3c246001c8.tar.bz2 |
kapi sync
Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/externalapphandler.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 59be506..f376e6c 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp | |||
@@ -802,96 +802,98 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e | |||
802 | else | 802 | else |
803 | { | 803 | { |
804 | DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(EMAIL, client); | 804 | DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(EMAIL, client); |
805 | if (!dai) | 805 | if (!dai) |
806 | { | 806 | { |
807 | qDebug("could not find configured email application."); | 807 | qDebug("could not find configured email application."); |
808 | return false; | 808 | return false; |
809 | } | 809 | } |
810 | channel = dai->_channel; | 810 | channel = dai->_channel; |
811 | message = dai->_message; | 811 | message = dai->_message; |
812 | parameters = dai->_parameters; | 812 | parameters = dai->_parameters; |
813 | } | 813 | } |
814 | 814 | ||
815 | #ifdef DESKTOP_VERSION | 815 | #ifdef DESKTOP_VERSION |
816 | //message = channel + " " +message + " \""+ parameters + "\""; | 816 | //message = channel + " " +message + " \""+ parameters + "\""; |
817 | #endif | 817 | #endif |
818 | //first check if one of the mailers need the emails right in the message. | 818 | //first check if one of the mailers need the emails right in the message. |
819 | message = translateMessage(message, name, emailadress); | 819 | message = translateMessage(message, name, emailadress); |
820 | 820 | ||
821 | #ifdef DEBUG_EXT_APP_HANDLER | 821 | #ifdef DEBUG_EXT_APP_HANDLER |
822 | qDebug("5Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); | 822 | qDebug("5Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); |
823 | qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1()); | 823 | qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1()); |
824 | #endif | 824 | #endif |
825 | 825 | ||
826 | #ifndef DESKTOP_VERSION | 826 | #ifndef DESKTOP_VERSION |
827 | QCopEnvelope e(channel.latin1(), message.latin1()); | 827 | QCopEnvelope e(channel.latin1(), message.latin1()); |
828 | //US we need no names in the To field. The emailadresses are enough | 828 | //US we need no names in the To field. The emailadresses are enough |
829 | 829 | ||
830 | passParameters(&e, parameters, name, emailadress); | 830 | passParameters(&e, parameters, name, emailadress); |
831 | #else // DESKTOP_VERSION | 831 | #else // DESKTOP_VERSION |
832 | 832 | ||
833 | //KMessageBox::sorry( 0,channel ); | 833 | //KMessageBox::sorry( 0,channel ); |
834 | QProcess * proc = new QProcess( this ); | 834 | QProcess * proc = new QProcess( this ); |
835 | proc->addArgument( channel ); | 835 | proc->addArgument( channel ); |
836 | if ( message.find (" " ) > 0 ) { | 836 | if ( message.find (" " ) > 0 ) { |
837 | QStringList list = QStringList::split( " ", message ); | 837 | QStringList list = QStringList::split( " ", message ); |
838 | int i = 0; | 838 | int i = 0; |
839 | while ( i < list.count ( ) ) { | 839 | while ( i < list.count ( ) ) { |
840 | //qDebug("add%sdd ",list[i].latin1() ); | 840 | //qDebug("add%sdd ",list[i].latin1() ); |
841 | proc->addArgument( list[i] ); | 841 | proc->addArgument( list[i] ); |
842 | //KMessageBox::sorry( 0,list[i]); | 842 | //KMessageBox::sorry( 0,list[i]); |
843 | ++i; | 843 | ++i; |
844 | } | 844 | } |
845 | } else { | 845 | } else { |
846 | proc->addArgument(message ); | 846 | proc->addArgument(message ); |
847 | 847 | ||
848 | } | 848 | } |
849 | parameters = translateMessage(parameters, name, emailadress); | 849 | parameters = translateMessage(parameters, name, emailadress); |
850 | |||
851 | //KMessageBox::information(0,parameters); | ||
850 | proc->addArgument( parameters ); | 852 | proc->addArgument( parameters ); |
851 | proc->launch(""); | 853 | proc->launch(""); |
852 | #endif | 854 | #endif |
853 | 855 | ||
854 | return true; | 856 | return true; |
855 | } | 857 | } |
856 | 858 | ||
857 | /************************************************************************** | 859 | /************************************************************************** |
858 | * | 860 | * |
859 | **************************************************************************/ | 861 | **************************************************************************/ |
860 | 862 | ||
861 | //calls the emailapplication and creates a mail with parameter as recipients | 863 | //calls the emailapplication and creates a mail with parameter as recipients |
862 | // parameters format is | 864 | // parameters format is |
863 | // NAME <EMAIL>:SUBJECT | 865 | // NAME <EMAIL>:SUBJECT |
864 | bool ExternalAppHandler::mailToOneContact( const QString& adressline ) | 866 | bool ExternalAppHandler::mailToOneContact( const QString& adressline ) |
865 | { | 867 | { |
866 | QString line = adressline; | 868 | QString line = adressline; |
867 | 869 | ||
868 | int first = line.find( "<"); | 870 | int first = line.find( "<"); |
869 | int last = line.find( ">"); | 871 | int last = line.find( ">"); |
870 | QString name = line.left(first); | 872 | QString name = line.left(first); |
871 | QString emailadress = line.mid(first+1, last-first-1); | 873 | QString emailadress = line.mid(first+1, last-first-1); |
872 | 874 | ||
873 | //Subject can not be handled right now. | 875 | //Subject can not be handled right now. |
874 | return mailToOneContact( name, emailadress ); | 876 | return mailToOneContact( name, emailadress ); |
875 | 877 | ||
876 | } | 878 | } |
877 | 879 | ||
878 | 880 | ||
879 | /************************************************************************** | 881 | /************************************************************************** |
880 | * | 882 | * |
881 | **************************************************************************/ | 883 | **************************************************************************/ |
882 | 884 | ||
883 | //calls the phoneapplication with the number | 885 | //calls the phoneapplication with the number |
884 | bool ExternalAppHandler::callByPhone( const QString& phonenumber ) | 886 | bool ExternalAppHandler::callByPhone( const QString& phonenumber ) |
885 | { | 887 | { |
886 | #ifndef DESKTOP_VERSION | 888 | #ifndef DESKTOP_VERSION |
887 | QString channel; | 889 | QString channel; |
888 | QString message; | 890 | QString message; |
889 | QString parameters; | 891 | QString parameters; |
890 | 892 | ||
891 | 893 | ||
892 | int client = KPimGlobalPrefs::instance()->mPhoneClient; | 894 | int client = KPimGlobalPrefs::instance()->mPhoneClient; |
893 | if (client == KPimGlobalPrefs::OTHER_PHC) | 895 | if (client == KPimGlobalPrefs::OTHER_PHC) |
894 | { | 896 | { |
895 | channel = KPimGlobalPrefs::instance()->mPhoneOtherChannel; | 897 | channel = KPimGlobalPrefs::instance()->mPhoneOtherChannel; |
896 | message = KPimGlobalPrefs::instance()->mPhoneOtherMessage; | 898 | message = KPimGlobalPrefs::instance()->mPhoneOtherMessage; |
897 | parameters = KPimGlobalPrefs::instance()->mPhoneOtherMessageParameters; | 899 | parameters = KPimGlobalPrefs::instance()->mPhoneOtherMessageParameters; |