author | zautrix <zautrix> | 2004-08-31 21:01:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-31 21:01:18 (UTC) |
commit | 3f5c51234c8068f3d4826a2a0066648ace21a19f (patch) (unidiff) | |
tree | 91b76c1c7ddec6628c573e409070070747d99feb /kmicromail | |
parent | 95f8d4f1de557bd25ae38807d970208399cec5d1 (diff) | |
download | kdepimpi-3f5c51234c8068f3d4826a2a0066648ace21a19f.zip kdepimpi-3f5c51234c8068f3d4826a2a0066648ace21a19f.tar.gz kdepimpi-3f5c51234c8068f3d4826a2a0066648ace21a19f.tar.bz2 |
Enhancements of kopiemail
-rw-r--r-- | kmicromail/accountview.cpp | 8 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/abstractmail.cpp | 29 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/abstractmail.h | 8 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.cpp | 6 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.h | 3 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 68 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.h | 6 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mhwrapper.cpp | 5 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mhwrapper.h | 3 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/nntpwrapper.cpp | 5 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/nntpwrapper.h | 3 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/pop3wrapper.cpp | 21 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/pop3wrapper.h | 4 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 44 | ||||
-rw-r--r-- | kmicromail/opiemail.h | 2 | ||||
-rw-r--r-- | kmicromail/selectstoreui.ui | 88 |
16 files changed, 244 insertions, 59 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index 0893733..4ead545 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp | |||
@@ -16,2 +16,4 @@ | |||
16 | #include <qpopupmenu.h> | 16 | #include <qpopupmenu.h> |
17 | #include <qcheckbox.h> | ||
18 | #include <qspinbox.h> | ||
17 | 19 | ||
@@ -160,3 +162,7 @@ void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrappe | |||
160 | } | 162 | } |
161 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails()); | 163 | int maxsize = 0; |
164 | if ( sels.useSize->isChecked()) | ||
165 | maxsize = sels.sizeSpinBox->value(); | ||
166 | |||
167 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); | ||
162 | refreshCurrent(); | 168 | refreshCurrent(); |
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp index 128a7c0..3998abd 100644 --- a/kmicromail/libmailwrapper/abstractmail.cpp +++ b/kmicromail/libmailwrapper/abstractmail.cpp | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #include "abstractmail.h" | 2 | #include "abstractmail.h" |
@@ -139,11 +140,24 @@ void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSma | |||
139 | } | 140 | } |
141 | void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) | ||
142 | { | ||
143 | qDebug("AbstractMail::deleteMailList:: Please reimplement! "); | ||
140 | 144 | ||
145 | } | ||
141 | void AbstractMail::mvcpAllMails(const FolderP&fromFolder, | 146 | void AbstractMail::mvcpAllMails(const FolderP&fromFolder, |
142 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 147 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) |
148 | { | ||
149 | QValueList<RecMailP> t; | ||
150 | listMessages(fromFolder->getName(),t, maxSizeInKb); | ||
151 | mvcpMailList( t,targetFolder,targetWrapper,moveit); | ||
152 | |||
153 | } | ||
154 | void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, | ||
155 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | ||
143 | { | 156 | { |
144 | QValueList<RecMailP> t; | 157 | |
145 | listMessages(fromFolder->getName(),t); | ||
146 | encodedString*st = 0; | 158 | encodedString*st = 0; |
147 | while (t.count()>0) { | 159 | int iii = 0; |
148 | RecMailP r = (*t.begin()); | 160 | int count = t.count(); |
161 | while (iii < count ) { | ||
162 | RecMailP r = (*t.at( iii )); | ||
149 | st = fetchRawBody(r); | 163 | st = fetchRawBody(r); |
@@ -153,6 +167,7 @@ void AbstractMail::mvcpAllMails(const FolderP&fromFolder, | |||
153 | } | 167 | } |
154 | t.remove(t.begin()); | 168 | ++iii; |
155 | } | 169 | } |
156 | if (moveit) { | 170 | if (moveit) { |
157 | deleteAllMail(fromFolder); | 171 | deleteMailList( t ); |
172 | //deleteAllMail(fromFolder); | ||
158 | } | 173 | } |
diff --git a/kmicromail/libmailwrapper/abstractmail.h b/kmicromail/libmailwrapper/abstractmail.h index e5d64a6..cae83f4 100644 --- a/kmicromail/libmailwrapper/abstractmail.h +++ b/kmicromail/libmailwrapper/abstractmail.h | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #ifndef __abstract_mail_ | 2 | #ifndef __abstract_mail_ |
@@ -24,3 +25,3 @@ public: | |||
24 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; | 25 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; |
25 | virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target )=0; | 26 | virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target, int sizeInKb = 0 )=0; |
26 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; | 27 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; |
@@ -33,2 +34,3 @@ public: | |||
33 | virtual void deleteMail(const RecMailP&mail)=0; | 34 | virtual void deleteMail(const RecMailP&mail)=0; |
35 | virtual void deleteMailList(const QValueList<RecMailP>&target); | ||
34 | virtual void answeredMail(const RecMailP&mail)=0; | 36 | virtual void answeredMail(const RecMailP&mail)=0; |
@@ -40,3 +42,5 @@ public: | |||
40 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, | 42 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, |
41 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 43 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int sizeInKb = 0); |
44 | virtual void mvcpMailList(const QValueList<RecMailP>& t, | ||
45 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | ||
42 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 46 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index f804e44..1fd4bb1 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #include "genericwrapper.h" | 2 | #include "genericwrapper.h" |
@@ -394,3 +395,3 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) | |||
394 | 395 | ||
395 | void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to) | 396 | void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) |
396 | { | 397 | { |
@@ -474,3 +475,4 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > & | |||
474 | } | 475 | } |
475 | target.append(mail); | 476 | if ( maxSizeInKb == 0 || mail->Msgsize()<=maxSizeInKb*1024 ) |
477 | target.append(mail); | ||
476 | } | 478 | } |
diff --git a/kmicromail/libmailwrapper/genericwrapper.h b/kmicromail/libmailwrapper/genericwrapper.h index 8be9212..235e116 100644 --- a/kmicromail/libmailwrapper/genericwrapper.h +++ b/kmicromail/libmailwrapper/genericwrapper.h | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #ifndef __GENERIC_WRAPPER_H | 2 | #ifndef __GENERIC_WRAPPER_H |
@@ -56,3 +57,3 @@ protected: | |||
56 | static QString getencoding(mailmime_mechanism*aEnc); | 57 | static QString getencoding(mailmime_mechanism*aEnc); |
57 | virtual void parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false); | 58 | virtual void parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); |
58 | QStringList parseInreplies(mailimf_in_reply_to * in_replies); | 59 | QStringList parseInreplies(mailimf_in_reply_to * in_replies); |
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index e0fb6f9..bb8bbfc 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #include <stdlib.h> | 2 | #include <stdlib.h> |
@@ -204,3 +205,3 @@ void IMAPwrapper::logout() | |||
204 | 205 | ||
205 | void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target ) | 206 | void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) |
206 | { | 207 | { |
@@ -252,6 +253,8 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma | |||
252 | if (m) { | 253 | if (m) { |
253 | m->setNumber(i); | 254 | if ( maxSizeInKb == 0 || m->Msgsize()<=maxSizeInKb*1024 ) { |
254 | m->setMbox(mailbox); | 255 | m->setNumber(i); |
255 | m->setWrapper(this); | 256 | m->setMbox(mailbox); |
256 | target.append(m); | 257 | m->setWrapper(this); |
258 | target.append(m); | ||
259 | } | ||
257 | } | 260 | } |
@@ -868,3 +871,45 @@ void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which | |||
868 | } | 871 | } |
872 | void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) | ||
873 | { | ||
874 | mailimap_flag_list*flist; | ||
875 | mailimap_set *set; | ||
876 | mailimap_store_att_flags * store_flags; | ||
877 | int err; | ||
878 | login(); | ||
879 | if (!m_imap) { | ||
880 | return; | ||
881 | } | ||
882 | int iii = 0; | ||
883 | int count = target.count(); | ||
884 | qDebug("imap remove count %d ", count); | ||
885 | while (iii < count ) { | ||
886 | qDebug("IMAP remove %d ", iii); | ||
887 | RecMailP mail = (*target.at( iii )); | ||
869 | 888 | ||
889 | err = selectMbox(mail->getMbox()); | ||
890 | if ( err != MAILIMAP_NO_ERROR ) { | ||
891 | return; | ||
892 | } | ||
893 | flist = mailimap_flag_list_new_empty(); | ||
894 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); | ||
895 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | ||
896 | set = mailimap_set_new_single(mail->getNumber()); | ||
897 | err = mailimap_store(m_imap,set,store_flags); | ||
898 | mailimap_set_free( set ); | ||
899 | mailimap_store_att_flags_free(store_flags); | ||
900 | |||
901 | if (err != MAILIMAP_NO_ERROR) { | ||
902 | // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; | ||
903 | return; | ||
904 | } | ||
905 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; | ||
906 | /* should we realy do that at this moment? */ | ||
907 | |||
908 | err = mailimap_expunge(m_imap); | ||
909 | if (err != MAILIMAP_NO_ERROR) { | ||
910 | Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); | ||
911 | } | ||
912 | ++iii; | ||
913 | } | ||
914 | } | ||
870 | void IMAPwrapper::deleteMail(const RecMailP&mail) | 915 | void IMAPwrapper::deleteMail(const RecMailP&mail) |
@@ -897,7 +942,9 @@ void IMAPwrapper::deleteMail(const RecMailP&mail) | |||
897 | /* should we realy do that at this moment? */ | 942 | /* should we realy do that at this moment? */ |
943 | |||
898 | err = mailimap_expunge(m_imap); | 944 | err = mailimap_expunge(m_imap); |
899 | if (err != MAILIMAP_NO_ERROR) { | 945 | if (err != MAILIMAP_NO_ERROR) { |
900 | // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; | 946 | Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); |
901 | } | 947 | } |
902 | // odebug << "Delete successfull " << m_imap->imap_response << "" << oendl; | 948 | qDebug("IMAPwrapper::deleteMail "); |
949 | |||
903 | } | 950 | } |
@@ -1122,6 +1169,7 @@ encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) | |||
1122 | void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, | 1169 | void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, |
1123 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 1170 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) |
1124 | { | 1171 | { |
1125 | if (targetWrapper != this) { | 1172 | if (targetWrapper != this || maxSizeInKb > 0 ) { |
1126 | AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); | 1173 | AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb); |
1174 | qDebug("IMAPwrapper::mvcpAllMails::Using generic"); | ||
1127 | // odebug << "Using generic" << oendl; | 1175 | // odebug << "Using generic" << oendl; |
diff --git a/kmicromail/libmailwrapper/imapwrapper.h b/kmicromail/libmailwrapper/imapwrapper.h index e56605a..222fe95 100644 --- a/kmicromail/libmailwrapper/imapwrapper.h +++ b/kmicromail/libmailwrapper/imapwrapper.h | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #ifndef __IMAPWRAPPER | 2 | #ifndef __IMAPWRAPPER |
@@ -26,3 +27,3 @@ public: | |||
26 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | 27 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); |
27 | virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); | 28 | virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); |
28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 29 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
@@ -30,2 +31,3 @@ public: | |||
30 | virtual void deleteMail(const RecMailP&mail); | 31 | virtual void deleteMail(const RecMailP&mail); |
32 | void deleteMailList(const QValueList<RecMailP>&target); | ||
31 | virtual void answeredMail(const RecMailP&mail); | 33 | virtual void answeredMail(const RecMailP&mail); |
@@ -34,3 +36,3 @@ public: | |||
34 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, | 36 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, |
35 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 37 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit,int sizeInKb = 0); |
36 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 38 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp index 7ef9b32..cbc52d9 100644 --- a/kmicromail/libmailwrapper/mhwrapper.cpp +++ b/kmicromail/libmailwrapper/mhwrapper.cpp | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #include "mhwrapper.h" | 2 | #include "mhwrapper.h" |
@@ -64,3 +65,3 @@ MHwrapper::~MHwrapper() | |||
64 | 65 | ||
65 | void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target ) | 66 | void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) |
66 | { | 67 | { |
@@ -76,3 +77,3 @@ void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSm | |||
76 | } | 77 | } |
77 | parseList(target,m_storage->sto_session,f); | 78 | parseList(target,m_storage->sto_session,f, false, maxSizeInKb ); |
78 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); | 79 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); |
diff --git a/kmicromail/libmailwrapper/mhwrapper.h b/kmicromail/libmailwrapper/mhwrapper.h index 4310c84..550824d 100644 --- a/kmicromail/libmailwrapper/mhwrapper.h +++ b/kmicromail/libmailwrapper/mhwrapper.h | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #ifndef __MH_WRAPPER_H | 2 | #ifndef __MH_WRAPPER_H |
@@ -19,3 +20,3 @@ public: | |||
19 | 20 | ||
20 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target ); | 21 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); |
21 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | 22 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); |
diff --git a/kmicromail/libmailwrapper/nntpwrapper.cpp b/kmicromail/libmailwrapper/nntpwrapper.cpp index daa128e..f5d7f16 100644 --- a/kmicromail/libmailwrapper/nntpwrapper.cpp +++ b/kmicromail/libmailwrapper/nntpwrapper.cpp | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #include "nntpwrapper.h" | 2 | #include "nntpwrapper.h" |
@@ -100,3 +101,3 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { | |||
100 | 101 | ||
101 | void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::Core::OSmartPointer<RecMail> > &target ) | 102 | void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb) |
102 | { | 103 | { |
@@ -107,3 +108,3 @@ void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::Core::OSm | |||
107 | mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); | 108 | mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); |
108 | parseList(target,m_nntp->sto_session,which,true); | 109 | parseList(target,m_nntp->sto_session,which,true, maxSizeInKb); |
109 | } | 110 | } |
diff --git a/kmicromail/libmailwrapper/nntpwrapper.h b/kmicromail/libmailwrapper/nntpwrapper.h index 2fb82f2..5d4e5ce 100644 --- a/kmicromail/libmailwrapper/nntpwrapper.h +++ b/kmicromail/libmailwrapper/nntpwrapper.h | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #ifndef __NNTPWRAPPER | 2 | #ifndef __NNTPWRAPPER |
@@ -22,3 +23,3 @@ public: | |||
22 | /* mailbox will be ignored */ | 23 | /* mailbox will be ignored */ |
23 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target ); | 24 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); |
24 | /* should only get the subscribed one */ | 25 | /* should only get the subscribed one */ |
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp index e5d083a..7a84b30 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.cpp +++ b/kmicromail/libmailwrapper/pop3wrapper.cpp | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #include <stdlib.h> | 2 | #include <stdlib.h> |
@@ -98,3 +99,3 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { | |||
98 | 99 | ||
99 | void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target ) | 100 | void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) |
100 | { | 101 | { |
@@ -105,3 +106,3 @@ void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPoi | |||
105 | mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); | 106 | mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); |
106 | parseList(target,m_pop3->sto_session,"INBOX"); | 107 | parseList(target,m_pop3->sto_session,"INBOX", false, maxSizeInKb); |
107 | Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages)); | 108 | Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages)); |
@@ -194,2 +195,18 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { | |||
194 | 195 | ||
196 | void POP3wrapper::deleteMailList(QValueList<RecMailP>&target) | ||
197 | { | ||
198 | login(); | ||
199 | if (!m_pop3) | ||
200 | return; | ||
201 | int iii = 0; | ||
202 | int count = target.count(); | ||
203 | while (iii < count ) { | ||
204 | RecMailP mail = (*target.at( iii )); | ||
205 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); | ||
206 | if (err != MAIL_NO_ERROR) { | ||
207 | Global::statusMessage(tr("error deleting mail")); | ||
208 | } | ||
209 | ++iii; | ||
210 | } | ||
211 | } | ||
195 | void POP3wrapper::deleteMail(const RecMailP&mail) { | 212 | void POP3wrapper::deleteMail(const RecMailP&mail) { |
diff --git a/kmicromail/libmailwrapper/pop3wrapper.h b/kmicromail/libmailwrapper/pop3wrapper.h index 5101fa5..ee754a4 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.h +++ b/kmicromail/libmailwrapper/pop3wrapper.h | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #ifndef __POP3WRAPPER | 2 | #ifndef __POP3WRAPPER |
@@ -19,3 +20,3 @@ public: | |||
19 | /* mailbox will be ignored */ | 20 | /* mailbox will be ignored */ |
20 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target ); | 21 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); |
21 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | 22 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); |
@@ -26,2 +27,3 @@ public: | |||
26 | virtual void answeredMail(const RecMailP&mail); | 27 | virtual void answeredMail(const RecMailP&mail); |
28 | virtual void deleteMailList(QValueList<RecMailP>&target); | ||
27 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); | 29 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); |
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index d522ad0..3fbdcec 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
@@ -280,2 +281,3 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | |||
280 | m->insertSeparator(); | 281 | m->insertSeparator(); |
282 | m->insertItem(tr("Copy/Move all selected mail"),this,SLOT(slotMoveCopyAllMail())); | ||
281 | m->insertItem(tr("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); | 283 | m->insertItem(tr("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); |
@@ -354,2 +356,44 @@ void OpieMail::slotMoveCopyMail() | |||
354 | 356 | ||
357 | void OpieMail::slotMoveCopyAllMail() | ||
358 | { | ||
359 | |||
360 | if (!mailView->currentItem()) return; | ||
361 | QValueList<RecMailP> t; | ||
362 | if ( QMessageBox::warning(this, tr("Copy/Move all selected mails"), tr("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | ||
363 | { | ||
364 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | ||
365 | while ( item ) { | ||
366 | if ( item->isSelected() ) { | ||
367 | t.append( item->data() ); | ||
368 | } | ||
369 | item = (MailListViewItem*)item->nextSibling(); | ||
370 | } | ||
371 | } | ||
372 | else | ||
373 | return; | ||
374 | if ( t.count() == 0 ) | ||
375 | return; | ||
376 | RecMailP mail = t.first(); | ||
377 | AbstractMail*targetMail = 0; | ||
378 | QString targetFolder = ""; | ||
379 | Selectstore sels; | ||
380 | folderView->setupFolderselect(&sels); | ||
381 | if (!sels.exec()) return; | ||
382 | targetMail = sels.currentMail(); | ||
383 | targetFolder = sels.currentFolder(); | ||
384 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || | ||
385 | targetFolder.isEmpty()) | ||
386 | { | ||
387 | return; | ||
388 | } | ||
389 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | ||
390 | { | ||
391 | QMessageBox::critical(0,tr("Error creating new Folder"), | ||
392 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | ||
393 | return; | ||
394 | } | ||
395 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); | ||
396 | folderView->refreshCurrent(); | ||
397 | } | ||
398 | |||
355 | void OpieMail::reEditMail() | 399 | void OpieMail::reEditMail() |
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h index 143b0c4..934f232 100644 --- a/kmicromail/opiemail.h +++ b/kmicromail/opiemail.h | |||
@@ -1 +1,2 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #ifndef OPIEMAIL_H | 2 | #ifndef OPIEMAIL_H |
@@ -37,2 +38,3 @@ protected slots: | |||
37 | virtual void slotMoveCopyMail(); | 38 | virtual void slotMoveCopyMail(); |
39 | virtual void slotMoveCopyAllMail(); | ||
38 | virtual void reEditMail(); | 40 | virtual void reEditMail(); |
diff --git a/kmicromail/selectstoreui.ui b/kmicromail/selectstoreui.ui index 5f0e507..dd3fc92 100644 --- a/kmicromail/selectstoreui.ui +++ b/kmicromail/selectstoreui.ui | |||
@@ -13,4 +13,4 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>182</width> | 14 | <width>275</width> |
15 | <height>273</height> | 15 | <height>304</height> |
16 | </rect> | 16 | </rect> |
@@ -27,6 +27,6 @@ | |||
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <grid> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>1</number> | 31 | <number>11</number> |
32 | </property> | 32 | </property> |
@@ -34,5 +34,5 @@ | |||
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>1</number> | 35 | <number>6</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget row="0" column="0" rowspan="1" colspan="2" > |
38 | <class>QLabel</class> | 38 | <class>QLabel</class> |
@@ -54,3 +54,3 @@ | |||
54 | </widget> | 54 | </widget> |
55 | <widget> | 55 | <widget row="1" column="0" rowspan="1" colspan="2" > |
56 | <class>QLayoutWidget</class> | 56 | <class>QLayoutWidget</class> |
@@ -142,3 +142,3 @@ | |||
142 | </widget> | 142 | </widget> |
143 | <widget> | 143 | <widget row="2" column="0" rowspan="1" colspan="2" > |
144 | <class>Line</class> | 144 | <class>Line</class> |
@@ -153,3 +153,3 @@ | |||
153 | </widget> | 153 | </widget> |
154 | <widget> | 154 | <widget row="3" column="0" rowspan="1" colspan="2" > |
155 | <class>QCheckBox</class> | 155 | <class>QCheckBox</class> |
@@ -164,3 +164,3 @@ | |||
164 | </widget> | 164 | </widget> |
165 | <widget> | 165 | <widget row="4" column="0" rowspan="1" colspan="2" > |
166 | <class>QLineEdit</class> | 166 | <class>QLineEdit</class> |
@@ -175,3 +175,3 @@ | |||
175 | </widget> | 175 | </widget> |
176 | <widget> | 176 | <widget row="5" column="0" rowspan="1" colspan="2" > |
177 | <class>QLabel</class> | 177 | <class>QLabel</class> |
@@ -196,3 +196,3 @@ | |||
196 | </widget> | 196 | </widget> |
197 | <widget> | 197 | <widget row="6" column="0" rowspan="1" colspan="2" > |
198 | <class>Line</class> | 198 | <class>Line</class> |
@@ -207,14 +207,3 @@ | |||
207 | </widget> | 207 | </widget> |
208 | <widget> | 208 | <spacer row="9" column="0" > |
209 | <class>QCheckBox</class> | ||
210 | <property stdset="1"> | ||
211 | <name>name</name> | ||
212 | <cstring>selMove</cstring> | ||
213 | </property> | ||
214 | <property stdset="1"> | ||
215 | <name>text</name> | ||
216 | <string>Move mail(s)</string> | ||
217 | </property> | ||
218 | </widget> | ||
219 | <spacer> | ||
220 | <property> | 209 | <property> |
@@ -239,3 +228,52 @@ | |||
239 | </spacer> | 228 | </spacer> |
240 | </vbox> | 229 | <widget row="8" column="0" rowspan="1" colspan="2" > |
230 | <class>QCheckBox</class> | ||
231 | <property stdset="1"> | ||
232 | <name>name</name> | ||
233 | <cstring>selMove</cstring> | ||
234 | </property> | ||
235 | <property stdset="1"> | ||
236 | <name>text</name> | ||
237 | <string>Move mail(s)</string> | ||
238 | </property> | ||
239 | </widget> | ||
240 | <widget row="7" column="0" > | ||
241 | <class>QCheckBox</class> | ||
242 | <property stdset="1"> | ||
243 | <name>name</name> | ||
244 | <cstring>useSize</cstring> | ||
245 | </property> | ||
246 | <property stdset="1"> | ||
247 | <name>text</name> | ||
248 | <string>apply only to mails smaller</string> | ||
249 | </property> | ||
250 | </widget> | ||
251 | <widget row="7" column="1" > | ||
252 | <class>QSpinBox</class> | ||
253 | <property stdset="1"> | ||
254 | <name>name</name> | ||
255 | <cstring>sizeSpinBox</cstring> | ||
256 | </property> | ||
257 | <property stdset="1"> | ||
258 | <name>suffix</name> | ||
259 | <string> kB</string> | ||
260 | </property> | ||
261 | <property stdset="1"> | ||
262 | <name>maxValue</name> | ||
263 | <number>8192</number> | ||
264 | </property> | ||
265 | <property stdset="1"> | ||
266 | <name>minValue</name> | ||
267 | <number>1</number> | ||
268 | </property> | ||
269 | <property stdset="1"> | ||
270 | <name>lineStep</name> | ||
271 | <number>1</number> | ||
272 | </property> | ||
273 | <property stdset="1"> | ||
274 | <name>value</name> | ||
275 | <number>5</number> | ||
276 | </property> | ||
277 | </widget> | ||
278 | </grid> | ||
241 | </widget> | 279 | </widget> |