summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2004-10-23 22:58:21 (UTC)
committer zautrix <zautrix>2004-10-23 22:58:21 (UTC)
commitfcea043d2200bb4bb0b1146a69204af15fb58a7d (patch) (unidiff)
treec2c210290c02f20af3b307f4c4e47ba8915f7a05 /kmicromail
parent22c26311ca936fa1036e406c86e0178c16acd090 (diff)
downloadkdepimpi-fcea043d2200bb4bb0b1146a69204af15fb58a7d.zip
kdepimpi-fcea043d2200bb4bb0b1146a69204af15fb58a7d.tar.gz
kdepimpi-fcea043d2200bb4bb0b1146a69204af15fb58a7d.tar.bz2
kopimail translation
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/mhwrapper.cpp13
-rw-r--r--kmicromail/libmailwrapper/sendmailprogress.cpp5
-rw-r--r--kmicromail/main.cpp1
-rw-r--r--kmicromail/opiemail.cpp1
4 files changed, 11 insertions, 9 deletions
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp
index 641d4d9..f4133c0 100644
--- a/kmicromail/libmailwrapper/mhwrapper.cpp
+++ b/kmicromail/libmailwrapper/mhwrapper.cpp
@@ -1,34 +1,35 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#include "mhwrapper.h" 2#include "mhwrapper.h"
3#include "mailtypes.h" 3#include "mailtypes.h"
4#include "mailwrapper.h" 4#include "mailwrapper.h"
5#include <libetpan/libetpan.h> 5#include <libetpan/libetpan.h>
6#include <qdir.h> 6#include <qdir.h>
7#include <qmessagebox.h> 7#include <qmessagebox.h>
8#include <stdlib.h> 8#include <stdlib.h>
9#include <qpe/global.h> 9#include <qpe/global.h>
10#include <oprocess.h> 10#include <oprocess.h>
11#include <klocale.h>
11//#include <opie2/odebug.h> 12//#include <opie2/odebug.h>
12 13
13using namespace Opie::Core; 14using namespace Opie::Core;
14MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) 15MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
15 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) 16 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name)
16{ 17{
17 if (MHPath.length()>0) { 18 if (MHPath.length()>0) {
18 if (MHPath[MHPath.length()-1]=='/') { 19 if (MHPath[MHPath.length()-1]=='/') {
19 MHPath=MHPath.left(MHPath.length()-1); 20 MHPath=MHPath.left(MHPath.length()-1);
20 } 21 }
21 //odebug << MHPath << oendl; 22 //odebug << MHPath << oendl;
22 QDir dir(MHPath); 23 QDir dir(MHPath);
23 if (!dir.exists()) { 24 if (!dir.exists()) {
24 dir.mkdir(MHPath); 25 dir.mkdir(MHPath);
25 } 26 }
26 init_storage(); 27 init_storage();
27 } 28 }
28} 29}
29 30
30void MHwrapper::init_storage() 31void MHwrapper::init_storage()
31{ 32{
32 int r; 33 int r;
33 QString pre = MHPath; 34 QString pre = MHPath;
34 if (!m_storage) { 35 if (!m_storage) {
@@ -55,49 +56,49 @@ void MHwrapper::clean_storage()
55 mailstorage_disconnect(m_storage); 56 mailstorage_disconnect(m_storage);
56 mailstorage_free(m_storage); 57 mailstorage_free(m_storage);
57 m_storage = 0; 58 m_storage = 0;
58 } 59 }
59} 60}
60 61
61MHwrapper::~MHwrapper() 62MHwrapper::~MHwrapper()
62{ 63{
63 clean_storage(); 64 clean_storage();
64} 65}
65 66
66void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) 67void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb )
67{ 68{
68 init_storage(); 69 init_storage();
69 if (!m_storage) { 70 if (!m_storage) {
70 return; 71 return;
71 } 72 }
72 QString f = buildPath(mailbox); 73 QString f = buildPath(mailbox);
73 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 74 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
74 if (r!=MAIL_NO_ERROR) { 75 if (r!=MAIL_NO_ERROR) {
75 qDebug("listMessages: error selecting folder! "); 76 qDebug("listMessages: error selecting folder! ");
76 return; 77 return;
77 } 78 }
78 parseList(target,m_storage->sto_session,f, false, maxSizeInKb ); 79 parseList(target,m_storage->sto_session,f, false, maxSizeInKb );
79 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); 80 Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count()));
80} 81}
81 82
82QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() 83QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders()
83{ 84{
84 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); 85 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >();
85 /* this is needed! */ 86 /* this is needed! */
86 if (m_storage) mailstorage_disconnect(m_storage); 87 if (m_storage) mailstorage_disconnect(m_storage);
87 init_storage(); 88 init_storage();
88 if (!m_storage) { 89 if (!m_storage) {
89 return folders; 90 return folders;
90 } 91 }
91 mail_list*flist = 0; 92 mail_list*flist = 0;
92 clistcell*current=0; 93 clistcell*current=0;
93 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist); 94 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist);
94 if (r != MAIL_NO_ERROR || !flist) { 95 if (r != MAIL_NO_ERROR || !flist) {
95 qDebug("error getting folder list "); 96 qDebug("error getting folder list ");
96 return folders; 97 return folders;
97 } 98 }
98 for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) { 99 for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) {
99 QString t = (char*)current->data; 100 QString t = (char*)current->data;
100 t.replace(0,MHPath.length(),""); 101 t.replace(0,MHPath.length(),"");
101 folders->append(new MHFolder(t,MHPath)); 102 folders->append(new MHFolder(t,MHPath));
102 } 103 }
103 mail_list_free(flist); 104 mail_list_free(flist);
@@ -211,54 +212,54 @@ void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder)
211 r = mailsession_append_message(m_storage->sto_session,(char*)msg,length); 212 r = mailsession_append_message(m_storage->sto_session,(char*)msg,length);
212 if (r!=MAIL_NO_ERROR) { 213 if (r!=MAIL_NO_ERROR) {
213 qDebug("error storing mail "); 214 qDebug("error storing mail ");
214 } 215 }
215 return; 216 return;
216} 217}
217 218
218encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) 219encodedString* MHwrapper::fetchRawBody(const RecMailP&mail)
219{ 220{
220 encodedString*result = 0; 221 encodedString*result = 0;
221 init_storage(); 222 init_storage();
222 if (!m_storage) { 223 if (!m_storage) {
223 return result; 224 return result;
224 } 225 }
225 mailmessage * msg = 0; 226 mailmessage * msg = 0;
226 char*data=0; 227 char*data=0;
227 size_t size; 228 size_t size;
228 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 229 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
229 if (r!=MAIL_NO_ERROR) { 230 if (r!=MAIL_NO_ERROR) {
230 qDebug("error selecting folder! "); 231 qDebug("error selecting folder! ");
231 return result; 232 return result;
232 } 233 }
233 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); 234 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg);
234 if (r != MAIL_NO_ERROR) { 235 if (r != MAIL_NO_ERROR) {
235 Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); 236 Global::statusMessage(i18n("Error fetching mail %i").arg(mail->getNumber()));
236 return 0; 237 return 0;
237 } 238 }
238 r = mailmessage_fetch(msg,&data,&size); 239 r = mailmessage_fetch(msg,&data,&size);
239 if (r != MAIL_NO_ERROR) { 240 if (r != MAIL_NO_ERROR) {
240 Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); 241 Global::statusMessage(i18n("Error fetching mail %i").arg(mail->getNumber()));
241 if (msg) mailmessage_free(msg); 242 if (msg) mailmessage_free(msg);
242 return 0; 243 return 0;
243 } 244 }
244 result = new encodedString(data,size); 245 result = new encodedString(data,size);
245 if (msg) mailmessage_free(msg); 246 if (msg) mailmessage_free(msg);
246 return result; 247 return result;
247} 248}
248 249
249void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) 250void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target)
250{ 251{
251 QString f = buildPath(mailbox); 252 QString f = buildPath(mailbox);
252 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 253 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
253 if (r!=MAIL_NO_ERROR) { 254 if (r!=MAIL_NO_ERROR) {
254 qDebug("deleteMails: error selecting folder! "); 255 qDebug("deleteMails: error selecting folder! ");
255 return; 256 return;
256 } 257 }
257 QValueList<RecMailP>::ConstIterator it; 258 QValueList<RecMailP>::ConstIterator it;
258 for (it=target.begin(); it!=target.end();++it) { 259 for (it=target.begin(); it!=target.end();++it) {
259 r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); 260 r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber());
260 if (r != MAIL_NO_ERROR) { 261 if (r != MAIL_NO_ERROR) {
261 qDebug("error deleting mail "); 262 qDebug("error deleting mail ");
262 break; 263 break;
263 } 264 }
264 } 265 }
@@ -269,49 +270,49 @@ int MHwrapper::deleteAllMail(const FolderP&tfolder)
269 init_storage(); 270 init_storage();
270 if (!m_storage) { 271 if (!m_storage) {
271 return 0; 272 return 0;
272 } 273 }
273 int res = 1; 274 int res = 1;
274 if (!tfolder) return 0; 275 if (!tfolder) return 0;
275 int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); 276 int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
276 if (r!=MAIL_NO_ERROR) { 277 if (r!=MAIL_NO_ERROR) {
277 qDebug("error selecting folder! "); 278 qDebug("error selecting folder! ");
278 return 0; 279 return 0;
279 } 280 }
280 mailmessage_list*l=0; 281 mailmessage_list*l=0;
281 r = mailsession_get_messages_list(m_storage->sto_session,&l); 282 r = mailsession_get_messages_list(m_storage->sto_session,&l);
282 if (r != MAIL_NO_ERROR) { 283 if (r != MAIL_NO_ERROR) {
283 qDebug("Error message list "); 284 qDebug("Error message list ");
284 res = 0; 285 res = 0;
285 } 286 }
286 unsigned j = 0; 287 unsigned j = 0;
287 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { 288 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) {
288 mailmessage * msg; 289 mailmessage * msg;
289 msg = (mailmessage*)carray_get(l->msg_tab, i); 290 msg = (mailmessage*)carray_get(l->msg_tab, i);
290 j = msg->msg_index; 291 j = msg->msg_index;
291 r = mailsession_remove_message(m_storage->sto_session,j); 292 r = mailsession_remove_message(m_storage->sto_session,j);
292 if (r != MAIL_NO_ERROR) { 293 if (r != MAIL_NO_ERROR) {
293 Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); 294 Global::statusMessage(i18n("Error deleting mail %1").arg(i+1));
294 res = 0; 295 res = 0;
295 break; 296 break;
296 } 297 }
297 } 298 }
298 if (l) mailmessage_list_free(l); 299 if (l) mailmessage_list_free(l);
299 return res; 300 return res;
300} 301}
301 302
302int MHwrapper::deleteMbox(const FolderP&tfolder) 303int MHwrapper::deleteMbox(const FolderP&tfolder)
303{ 304{
304 init_storage(); 305 init_storage();
305 if (!m_storage) { 306 if (!m_storage) {
306 return 0; 307 return 0;
307 } 308 }
308 if (!tfolder) return 0; 309 if (!tfolder) return 0;
309 if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; 310 if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0;
310 311
311 int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); 312 int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
312 313
313 if (r != MAIL_NO_ERROR) { 314 if (r != MAIL_NO_ERROR) {
314 qDebug("error deleting mail box "); 315 qDebug("error deleting mail box ");
315 return 0; 316 return 0;
316 } 317 }
317 QString cmd = "rm -rf "+tfolder->getName(); 318 QString cmd = "rm -rf "+tfolder->getName();
@@ -323,66 +324,66 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
323 324
324 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), 325 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
325 this, SLOT( processEnded(Opie::Core::OProcess*))); 326 this, SLOT( processEnded(Opie::Core::OProcess*)));
326 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), 327 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
327 this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); 328 this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int)));
328 329
329 *process << command; 330 *process << command;
330 removeMboxfailed = false; 331 removeMboxfailed = false;
331 if(!process->start(OProcess::Block, OProcess::All) ) { 332 if(!process->start(OProcess::Block, OProcess::All) ) {
332 qDebug("could not start process "); 333 qDebug("could not start process ");
333 return 0; 334 return 0;
334 } 335 }
335 qDebug("mail box deleted "); 336 qDebug("mail box deleted ");
336 return 1; 337 return 1;
337} 338}
338 339
339void MHwrapper::processEnded(OProcess *p) 340void MHwrapper::processEnded(OProcess *p)
340{ 341{
341 if (p) delete p; 342 if (p) delete p;
342} 343}
343 344
344void MHwrapper::oprocessStderr(OProcess*, char *buffer, int ) 345void MHwrapper::oprocessStderr(OProcess*, char *buffer, int )
345{ 346{
346 QString lineStr = buffer; 347 QString lineStr = buffer;
347 QMessageBox::warning( 0, tr("Error"), lineStr ,tr("Ok") ); 348 QMessageBox::warning( 0, i18n("Error"), lineStr ,i18n("Ok") );
348 removeMboxfailed = true; 349 removeMboxfailed = true;
349} 350}
350 351
351void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) 352void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
352{ 353{
353 init_storage(); 354 init_storage();
354 if (!m_storage) { 355 if (!m_storage) {
355 return; 356 return;
356 } 357 }
357 target_stat.message_count = 0; 358 target_stat.message_count = 0;
358 target_stat.message_unseen = 0; 359 target_stat.message_unseen = 0;
359 target_stat.message_recent = 0; 360 target_stat.message_recent = 0;
360 QString f = buildPath(mailbox); 361 QString f = buildPath(mailbox);
361 int r = mailsession_status_folder(m_storage->sto_session,(char*)f.latin1(),&target_stat.message_count, 362 int r = mailsession_status_folder(m_storage->sto_session,(char*)f.latin1(),&target_stat.message_count,
362 &target_stat.message_recent,&target_stat.message_unseen); 363 &target_stat.message_recent,&target_stat.message_unseen);
363 if (r != MAIL_NO_ERROR) { 364 if (r != MAIL_NO_ERROR) {
364 Global::statusMessage(tr("Error retrieving status")); 365 Global::statusMessage(i18n("Error retrieving status"));
365 } 366 }
366} 367}
367 368
368MAILLIB::ATYPE MHwrapper::getType()const 369MAILLIB::ATYPE MHwrapper::getType()const
369{ 370{
370 return MAILLIB::A_MH; 371 return MAILLIB::A_MH;
371} 372}
372 373
373const QString&MHwrapper::getName()const 374const QString&MHwrapper::getName()const
374{ 375{
375 return MHName; 376 return MHName;
376} 377}
377void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 378void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
378{ 379{
379 init_storage(); 380 init_storage();
380 if (!m_storage) { 381 if (!m_storage) {
381 return; 382 return;
382 } 383 }
383 if (targetWrapper != this) { 384 if (targetWrapper != this) {
384 qDebug("Using generic "); 385 qDebug("Using generic ");
385 Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit); 386 Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit);
386 return; 387 return;
387 } 388 }
388 qDebug("Using internal routines for move/copy "); 389 qDebug("Using internal routines for move/copy ");
diff --git a/kmicromail/libmailwrapper/sendmailprogress.cpp b/kmicromail/libmailwrapper/sendmailprogress.cpp
index dc0c75a..20dfe9b 100644
--- a/kmicromail/libmailwrapper/sendmailprogress.cpp
+++ b/kmicromail/libmailwrapper/sendmailprogress.cpp
@@ -1,47 +1,48 @@
1#include "sendmailprogress.h" 1#include "sendmailprogress.h"
2#include <qprogressbar.h> 2#include <qprogressbar.h>
3#include <qlabel.h> 3#include <qlabel.h>
4#include <klocale.h>
4 5
5progressMailSend::progressMailSend(QWidget*parent, const char * name) 6progressMailSend::progressMailSend(QWidget*parent, const char * name)
6 :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0) 7 :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0)
7{ 8{
8} 9}
9 10
10progressMailSend::~progressMailSend() 11progressMailSend::~progressMailSend()
11{ 12{
12} 13}
13 14
14void progressMailSend::setMaxMails(unsigned int aMaxMails) 15void progressMailSend::setMaxMails(unsigned int aMaxMails)
15{ 16{
16 m_max_mail = aMaxMails; 17 m_max_mail = aMaxMails;
17 allMailProgressBar->setTotalSteps(aMaxMails); 18 allMailProgressBar->setTotalSteps(aMaxMails);
18 setMails(); 19 setMails();
19} 20}
20 21
21void progressMailSend::setCurrentMails(unsigned int aCurrent) 22void progressMailSend::setCurrentMails(unsigned int aCurrent)
22{ 23{
23 m_current_mail = aCurrent; 24 m_current_mail = aCurrent;
24 allMailProgressBar->setProgress(aCurrent); 25 allMailProgressBar->setProgress(aCurrent);
25 setMails(); 26 setMails();
26} 27}
27 28
28void progressMailSend::setSingleMail(unsigned int aCurrent,unsigned int aMax) 29void progressMailSend::setSingleMail(unsigned int aCurrent,unsigned int aMax)
29{ 30{
30 m_current_single = aCurrent; 31 m_current_single = aCurrent;
31 m_max_single = aMax; 32 m_max_single = aMax;
32 setSingle(); 33 setSingle();
33} 34}
34 35
35void progressMailSend::setSingle() 36void progressMailSend::setSingle()
36{ 37{
37 QString text = QString(tr("%1 of %2 bytes send")).arg(m_current_single).arg(m_max_single); 38 QString text = QString(i18n("%1 of %2 bytes send")).arg(m_current_single).arg(m_max_single);
38 singleMailLabel->setText(text); 39 singleMailLabel->setText(text);
39 singleMailProgressBar->setTotalSteps(m_max_single); 40 singleMailProgressBar->setTotalSteps(m_max_single);
40 singleMailProgressBar->setProgress(m_current_single); 41 singleMailProgressBar->setProgress(m_current_single);
41} 42}
42 43
43void progressMailSend::setMails() 44void progressMailSend::setMails()
44{ 45{
45 QString text = QString(tr("Sending mail %1 of %2")).arg(m_current_mail+1).arg(m_max_mail); 46 QString text = QString(i18n("Sending mail %1 of %2")).arg(m_current_mail+1).arg(m_max_mail);
46 allMailLabel->setText(text); 47 allMailLabel->setText(text);
47} 48}
diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp
index 8341c5a..006390c 100644
--- a/kmicromail/main.cpp
+++ b/kmicromail/main.cpp
@@ -24,43 +24,44 @@ void dumpMissing();
24//using namespace Opie::Core; 24//using namespace Opie::Core;
25int main( int argc, char **argv ) { 25int main( int argc, char **argv ) {
26 26
27#ifndef DESKTOP_VERSION 27#ifndef DESKTOP_VERSION
28 QPEApplication a( argc, argv ); 28 QPEApplication a( argc, argv );
29 a.setKeepRunning (); 29 a.setKeepRunning ();
30#else 30#else
31 QApplication a( argc, argv ); 31 QApplication a( argc, argv );
32 QApplication::setStyle( new QPlatinumStyle ()); 32 QApplication::setStyle( new QPlatinumStyle ());
33#endif 33#endif
34 a.setFont( KOPrefs::instance()->mAppFont ); 34 a.setFont( KOPrefs::instance()->mAppFont );
35 KGlobal::setAppName( "kopiemail" ); 35 KGlobal::setAppName( "kopiemail" );
36 QString fileName ; 36 QString fileName ;
37#ifndef DESKTOP_VERSION 37#ifndef DESKTOP_VERSION
38 fileName = getenv("QPEDIR"); 38 fileName = getenv("QPEDIR");
39 if ( QApplication::desktop()->width() > 320 ) 39 if ( QApplication::desktop()->width() > 320 )
40 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/icons22/"); 40 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/icons22/");
41 else 41 else
42 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/"); 42 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/");
43#else 43#else
44 fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/"; 44 fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/";
45 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 45 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
46#endif 46#endif
47 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail"))); 47 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail")));
48 KPimGlobalPrefs::instance()->setGlobalConfig();
48 OpieMail mw; 49 OpieMail mw;
49#ifndef DESKTOP_VERSION 50#ifndef DESKTOP_VERSION
50 //qDebug("CONNECT "); 51 //qDebug("CONNECT ");
51 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& ))); 52 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& )));
52 // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 53 // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
53 a.showMainWidget(&mw ); 54 a.showMainWidget(&mw );
54#else 55#else
55 a.setMainWidget(&mw ); 56 a.setMainWidget(&mw );
56 mw.show(); 57 mw.show();
57 //m.resize( 800, 600 ); 58 //m.resize( 800, 600 );
58 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 59 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
59#endif 60#endif
60 int rv = a.exec(); 61 int rv = a.exec();
61 dumpMissing(); 62 dumpMissing();
62 63
63 KPimGlobalPrefs::instance()->writeConfig(); 64 KPimGlobalPrefs::instance()->writeConfig();
64 return rv; 65 return rv;
65 66
66} 67}
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 3aa7905..a32983c 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -13,49 +13,48 @@
13#include "koprefsdialog.h" 13#include "koprefsdialog.h"
14#include "klocale.h" 14#include "klocale.h"
15 15
16#include <qmessagebox.h> 16#include <qmessagebox.h>
17#include <qtimer.h> 17#include <qtimer.h>
18#include <libkdepim/externalapphandler.h> 18#include <libkdepim/externalapphandler.h>
19#include <libkdepim/kpimglobalprefs.h> 19#include <libkdepim/kpimglobalprefs.h>
20 20
21#include <qpe/qpeapplication.h> 21#include <qpe/qpeapplication.h>
22#include <libmailwrapper/smtpwrapper.h> 22#include <libmailwrapper/smtpwrapper.h>
23#include <libmailwrapper/mailtypes.h> 23#include <libmailwrapper/mailtypes.h>
24#include <libmailwrapper/abstractmail.h> 24#include <libmailwrapper/abstractmail.h>
25/* OPIE */ 25/* OPIE */
26//#include <qpe/resource.h> 26//#include <qpe/resource.h>
27//#include <qpe/qpeapplication.h> 27//#include <qpe/qpeapplication.h>
28 28
29/* QT */ 29/* QT */
30 30
31//using namespace Opie::Core; 31//using namespace Opie::Core;
32 32
33OpieMail::OpieMail( QWidget *parent, const char *name ) 33OpieMail::OpieMail( QWidget *parent, const char *name )
34 : MainWindow( parent, name) //, WStyle_ContextHelp ) 34 : MainWindow( parent, name) //, WStyle_ContextHelp )
35{ 35{
36 settings = new Settings(); 36 settings = new Settings();
37 KPimGlobalPrefs::instance()->setGlobalConfig();
38 37
39 folderView->populate( settings->getAccounts() ); 38 folderView->populate( settings->getAccounts() );
40 39
41} 40}
42 41
43OpieMail::~OpieMail() 42OpieMail::~OpieMail()
44{ 43{
45 if (settings) delete settings; 44 if (settings) delete settings;
46} 45}
47 46
48void OpieMail::appMessage(const QCString &msg, const QByteArray &data) 47void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
49{ 48{
50 49
51} 50}
52#include <stdlib.h> 51#include <stdlib.h>
53void OpieMail::message(const QCString &msg, const QByteArray &data) 52void OpieMail::message(const QCString &msg, const QByteArray &data)
54{ 53{
55 // copied from old mail2 54 // copied from old mail2
56 static int ii = 0; 55 static int ii = 0;
57 //qDebug("QCOP CALL ############################# %d ", ii); 56 //qDebug("QCOP CALL ############################# %d ", ii);
58 //QString mess ( msg ); 57 //QString mess ( msg );
59 //qDebug("Message = %s ",mess.latin1()); 58 //qDebug("Message = %s ",mess.latin1());
60 ++ii; 59 ++ii;
61 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); 60 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this);