author | zautrix <zautrix> | 2004-09-11 18:10:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-11 18:10:31 (UTC) |
commit | 53dda80aaab72d7efdbed8a206dc1fa64fed10ee (patch) (unidiff) | |
tree | 23b5248145679628c0d346f7d42c53714634e1a3 /kmicromail/libmailwrapper/imapwrapper.cpp | |
parent | 438403295657bdcab9ee9e526c6a08894e876f63 (diff) | |
download | kdepimpi-53dda80aaab72d7efdbed8a206dc1fa64fed10ee.zip kdepimpi-53dda80aaab72d7efdbed8a206dc1fa64fed10ee.tar.gz kdepimpi-53dda80aaab72d7efdbed8a206dc1fa64fed10ee.tar.bz2 |
progress fixes
Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 91332c3..d79df4f 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -899,100 +899,103 @@ void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which | |||
899 | encoding = "7bit"; | 899 | encoding = "7bit"; |
900 | break; | 900 | break; |
901 | case MAILIMAP_BODY_FLD_ENC_8BIT: | 901 | case MAILIMAP_BODY_FLD_ENC_8BIT: |
902 | encoding = "8bit"; | 902 | encoding = "8bit"; |
903 | break; | 903 | break; |
904 | case MAILIMAP_BODY_FLD_ENC_BINARY: | 904 | case MAILIMAP_BODY_FLD_ENC_BINARY: |
905 | encoding="binary"; | 905 | encoding="binary"; |
906 | break; | 906 | break; |
907 | case MAILIMAP_BODY_FLD_ENC_BASE64: | 907 | case MAILIMAP_BODY_FLD_ENC_BASE64: |
908 | encoding="base64"; | 908 | encoding="base64"; |
909 | break; | 909 | break; |
910 | case MAILIMAP_BODY_FLD_ENC_QUOTED_PRINTABLE: | 910 | case MAILIMAP_BODY_FLD_ENC_QUOTED_PRINTABLE: |
911 | encoding="quoted-printable"; | 911 | encoding="quoted-printable"; |
912 | break; | 912 | break; |
913 | case MAILIMAP_BODY_FLD_ENC_OTHER: | 913 | case MAILIMAP_BODY_FLD_ENC_OTHER: |
914 | default: | 914 | default: |
915 | if (enc->enc_value) { | 915 | if (enc->enc_value) { |
916 | char*t=enc->enc_value; | 916 | char*t=enc->enc_value; |
917 | encoding=QString(enc->enc_value); | 917 | encoding=QString(enc->enc_value); |
918 | enc->enc_value=0L; | 918 | enc->enc_value=0L; |
919 | free(t); | 919 | free(t); |
920 | } | 920 | } |
921 | } | 921 | } |
922 | if (which->bd_description) { | 922 | if (which->bd_description) { |
923 | target_part->setDescription(QString(which->bd_description)); | 923 | target_part->setDescription(QString(which->bd_description)); |
924 | } | 924 | } |
925 | target_part->setEncoding(encoding); | 925 | target_part->setEncoding(encoding); |
926 | target_part->setSize(which->bd_size); | 926 | target_part->setSize(which->bd_size); |
927 | } | 927 | } |
928 | void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) | 928 | void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) |
929 | { | 929 | { |
930 | //#if 0 | 930 | //#if 0 |
931 | mailimap_flag_list*flist; | 931 | mailimap_flag_list*flist; |
932 | mailimap_set *set; | 932 | mailimap_set *set; |
933 | mailimap_store_att_flags * store_flags; | 933 | mailimap_store_att_flags * store_flags; |
934 | int err; | 934 | int err; |
935 | login(); | 935 | login(); |
936 | //#endif | 936 | //#endif |
937 | if (!m_imap) { | 937 | if (!m_imap) { |
938 | return; | 938 | return; |
939 | } | 939 | } |
940 | int iii = 0; | 940 | int iii = 0; |
941 | int count = target.count(); | 941 | int count = target.count(); |
942 | // qDebug("imap remove count %d ", count); | 942 | // qDebug("imap remove count %d ", count); |
943 | 943 | ||
944 | 944 | ||
945 | mMax = count; | 945 | mMax = count; |
946 | //progress( tr("Delete")); | 946 | //progress( tr("Delete")); |
947 | QWidget wid; | 947 | |
948 | QProgressBar wid ( count ); | ||
949 | wid.setCaption( tr("Deleting ...")); | ||
948 | wid.show(); | 950 | wid.show(); |
949 | while (iii < count ) { | 951 | while (iii < count ) { |
950 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); | 952 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
953 | wid.setProgress( iii ); | ||
951 | wid.raise(); | 954 | wid.raise(); |
952 | qApp->processEvents(); | 955 | qApp->processEvents(); |
953 | RecMailP mail = (*target.at( iii )); | 956 | RecMailP mail = (*target.at( iii )); |
954 | //#if 0 | 957 | //#if 0 |
955 | //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); | 958 | //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); |
956 | err = selectMbox(mail->getMbox()); | 959 | err = selectMbox(mail->getMbox()); |
957 | if ( err != MAILIMAP_NO_ERROR ) { | 960 | if ( err != MAILIMAP_NO_ERROR ) { |
958 | return; | 961 | return; |
959 | } | 962 | } |
960 | flist = mailimap_flag_list_new_empty(); | 963 | flist = mailimap_flag_list_new_empty(); |
961 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); | 964 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); |
962 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | 965 | store_flags = mailimap_store_att_flags_new_set_flags(flist); |
963 | set = mailimap_set_new_single(mail->getNumber()); | 966 | set = mailimap_set_new_single(mail->getNumber()); |
964 | err = mailimap_store(m_imap,set,store_flags); | 967 | err = mailimap_store(m_imap,set,store_flags); |
965 | mailimap_set_free( set ); | 968 | mailimap_set_free( set ); |
966 | mailimap_store_att_flags_free(store_flags); | 969 | mailimap_store_att_flags_free(store_flags); |
967 | 970 | ||
968 | if (err != MAILIMAP_NO_ERROR) { | 971 | if (err != MAILIMAP_NO_ERROR) { |
969 | // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; | 972 | // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; |
970 | return; | 973 | return; |
971 | } | 974 | } |
972 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; | 975 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; |
973 | /* should we realy do that at this moment? */ | 976 | /* should we realy do that at this moment? */ |
974 | 977 | ||
975 | // err = mailimap_expunge(m_imap); | 978 | // err = mailimap_expunge(m_imap); |
976 | //if (err != MAILIMAP_NO_ERROR) { | 979 | //if (err != MAILIMAP_NO_ERROR) { |
977 | // Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response)); | 980 | // Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response)); |
978 | // } | 981 | // } |
979 | //#endif | 982 | //#endif |
980 | //deleteMail( mail); | 983 | //deleteMail( mail); |
981 | ++iii; | 984 | ++iii; |
982 | } | 985 | } |
983 | //qDebug("Deleting imap mails... "); | 986 | //qDebug("Deleting imap mails... "); |
984 | err = mailimap_expunge(m_imap); | 987 | err = mailimap_expunge(m_imap); |
985 | if (err != MAILIMAP_NO_ERROR) { | 988 | if (err != MAILIMAP_NO_ERROR) { |
986 | Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response)); | 989 | Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response)); |
987 | } | 990 | } |
988 | } | 991 | } |
989 | void IMAPwrapper::deleteMail(const RecMailP&mail) | 992 | void IMAPwrapper::deleteMail(const RecMailP&mail) |
990 | { | 993 | { |
991 | mailimap_flag_list*flist; | 994 | mailimap_flag_list*flist; |
992 | mailimap_set *set; | 995 | mailimap_set *set; |
993 | mailimap_store_att_flags * store_flags; | 996 | mailimap_store_att_flags * store_flags; |
994 | int err; | 997 | int err; |
995 | login(); | 998 | login(); |
996 | if (!m_imap) { | 999 | if (!m_imap) { |
997 | return; | 1000 | return; |
998 | } | 1001 | } |