author | zautrix <zautrix> | 2005-03-18 21:38:19 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-18 21:38:19 (UTC) |
commit | f0232b7801f098b5842e3cd5a1fd804af98ab862 (patch) (unidiff) | |
tree | 7537ad5f4b86a4c7e0965051ce0082bcb8d023fa | |
parent | 246da4d3796f5e03a3ce5f2b2febe9e1c8dd7a7e (diff) | |
download | kdepimpi-f0232b7801f098b5842e3cd5a1fd804af98ab862.zip kdepimpi-f0232b7801f098b5842e3cd5a1fd804af98ab862.tar.gz kdepimpi-f0232b7801f098b5842e3cd5a1fd804af98ab862.tar.bz2 |
etpan fixes
-rw-r--r-- | kmicromail/libmailwrapper/mhwrapper.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp index 982d7a6..787e85d 100644 --- a/kmicromail/libmailwrapper/mhwrapper.cpp +++ b/kmicromail/libmailwrapper/mhwrapper.cpp | |||
@@ -173,29 +173,35 @@ QString MHwrapper::buildPath(const QString&p) | |||
173 | f+=p; | 173 | f+=p; |
174 | return f; | 174 | return f; |
175 | } | 175 | } |
176 | 176 | ||
177 | int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QString&,bool ) | 177 | int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QString&,bool ) |
178 | { | 178 | { |
179 | init_storage(); | 179 | |
180 | if (!m_storage) { | ||
181 | return 0; | ||
182 | } | ||
183 | QString f; | 180 | QString f; |
184 | if (!pfolder) { | 181 | if (!pfolder) { |
185 | // toplevel folder | 182 | // toplevel folder |
186 | f = buildPath(folder); | 183 | f = buildPath(folder); |
187 | } else { | 184 | } else { |
188 | f = pfolder->getName(); | 185 | f = pfolder->getName(); |
189 | f+="/"; | 186 | f+="/"; |
190 | f+=folder; | 187 | f+=folder; |
191 | } | 188 | } |
192 | 189 | QFileInfo fi ( f ); | |
190 | if ( fi. exists () ) { | ||
191 | qDebug("folder exists "); | ||
192 | return 1; | ||
193 | } | ||
194 | qDebug("creating folder ---%s--- ",f.latin1() ); | ||
195 | init_storage(); | ||
196 | if (!m_storage) { | ||
197 | return 0; | ||
198 | } | ||
193 | int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1()); | 199 | int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1()); |
194 | if (r != MAIL_NO_ERROR) { | 200 | if (r != MAIL_NO_ERROR) { |
195 | qDebug("error creating folder "); | 201 | qDebug("error %d creating folder %s", r, f.latin1()); |
196 | return 0; | 202 | return 0; |
197 | } | 203 | } |
198 | return 1; | 204 | return 1; |
199 | } | 205 | } |
200 | 206 | ||
201 | void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder) | 207 | void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder) |
@@ -204,18 +210,19 @@ void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder) | |||
204 | if (!m_storage) { | 210 | if (!m_storage) { |
205 | return; | 211 | return; |
206 | } | 212 | } |
207 | QString f = buildPath(Folder); | 213 | QString f = buildPath(Folder); |
208 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); | 214 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); |
209 | if (r!=MAIL_NO_ERROR) { | 215 | if (r!=MAIL_NO_ERROR) { |
210 | qDebug("error selecting folder! "); | 216 | qDebug("error selecting folder %d", r); |
211 | return; | 217 | return; |
212 | } | 218 | } |
213 | r = mailsession_append_message(m_storage->sto_session,(char*)msg,length); | 219 | r = mailsession_append_message(m_storage->sto_session,(char*)msg,length); |
214 | if (r!=MAIL_NO_ERROR) { | 220 | if (r!=MAIL_NO_ERROR) { |
215 | qDebug("error storing mail "); | 221 | if ( r != MAIL_ERROR_APPEND ) |
222 | qDebug("error storing mail %d", r); | ||
216 | } | 223 | } |
217 | return; | 224 | return; |
218 | } | 225 | } |
219 | 226 | ||
220 | encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) | 227 | encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) |
221 | { | 228 | { |