summaryrefslogtreecommitdiffabout
path: root/kmicromail
Unidiff
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
@@ -5,12 +5,13 @@
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{
@@ -73,13 +74,13 @@ void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSm
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! */
@@ -229,18 +230,18 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail)
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;
@@ -287,13 +288,13 @@ int MHwrapper::deleteAllMail(const FolderP&tfolder)
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;
@@ -341,13 +342,13 @@ void MHwrapper::processEnded(OProcess *p)
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();
@@ -358,13 +359,13 @@ void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
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;
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,9 +1,10 @@
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
@@ -31,17 +32,17 @@ void progressMailSend::setSingleMail(unsigned int aCurrent,unsigned int aMax)
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
@@ -42,12 +42,13 @@ int main( int argc, char **argv ) {
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 );
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 3aa7905..a32983c 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -31,13 +31,12 @@
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()