summaryrefslogtreecommitdiff
path: root/noncore/unsupported
Unidiff
Diffstat (limited to 'noncore/unsupported') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mailit/emailclient.cpp12
-rw-r--r--noncore/unsupported/mailit/emaillistitem.cpp61
-rw-r--r--noncore/unsupported/mailit/emaillistitem.h1
-rw-r--r--noncore/unsupported/mailit/mailit.pro6
-rw-r--r--noncore/unsupported/mailit/mailitwindow.h1
-rw-r--r--noncore/unsupported/mailit/main.cpp10
6 files changed, 72 insertions, 19 deletions
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp
index 90664bb..8359acf 100644
--- a/noncore/unsupported/mailit/emailclient.cpp
+++ b/noncore/unsupported/mailit/emailclient.cpp
@@ -281,7 +281,7 @@ void EmailClient::sendQuedMail()
281 int count = 0; 281 int count = 0;
282 282
283 if (accountList.count() == 0) { 283 if (accountList.count() == 0) {
284 QMessageBox::warning(qApp->activeWindow(), "No account selected", "You must create an account", "OK\n"); 284 QMessageBox::warning(qApp->activeWindow(), tr("No account selected"), tr("You must create an account"), "OK\n");
285 return; 285 return;
286 } 286 }
287 //traverse listview, find messages to send 287 //traverse listview, find messages to send
@@ -321,8 +321,8 @@ void EmailClient::mailSent()
321void EmailClient::getNewMail() { 321void EmailClient::getNewMail() {
322 322
323 if (accountList.count() == 0) { 323 if (accountList.count() == 0) {
324 QMessageBox::warning(qApp->activeWindow(),"No account selected", 324 QMessageBox::warning(qApp->activeWindow(),tr("No account selected"),
325 "You must create an account", "OK\n"); 325 tr("You must create an account"), "OK\n");
326 return; 326 return;
327 } 327 }
328 328
@@ -785,7 +785,7 @@ void EmailClient::selectAccount(int id)
785 emit newCaption("Mailit - " + currentAccount->accountName); 785 emit newCaption("Mailit - " + currentAccount->accountName);
786 getNewMail(); 786 getNewMail();
787 } else { 787 } else {
788 emit newCaption("Mailit ! No account defined"); 788 emit newCaption( tr("Mailit ! No account defined") );
789 } 789 }
790} 790}
791 791
@@ -825,7 +825,7 @@ void EmailClient::deleteAccount(int id)
825 QString message; 825 QString message;
826 826
827 newAccount = accountList.at(id); 827 newAccount = accountList.at(id);
828 message = "Delete account:\n" + newAccount->accountName; 828 message = tr("Delete account:\n") + newAccount->accountName;
829 switch( QMessageBox::warning( this, "Mailit", message, 829 switch( QMessageBox::warning( this, "Mailit", message,
830 "Yes", "No", 0, 0, 1 ) ) { 830 "Yes", "No", 0, 0, 1 ) ) {
831 831
@@ -846,7 +846,7 @@ void EmailClient::updateAccounts()
846 selectAccountMenu->clear(); 846 selectAccountMenu->clear();
847 deleteAccountMenu->clear(); 847 deleteAccountMenu->clear();
848 848
849 newAccountId = editAccountMenu->insertItem("New", this, 849 newAccountId = editAccountMenu->insertItem( tr("New"), this,
850 SLOT(editAccount(int)) ); 850 SLOT(editAccount(int)) );
851 editAccountMenu->insertSeparator(); 851 editAccountMenu->insertSeparator();
852 852
diff --git a/noncore/unsupported/mailit/emaillistitem.cpp b/noncore/unsupported/mailit/emaillistitem.cpp
index fc9f766..a25f93a 100644
--- a/noncore/unsupported/mailit/emaillistitem.cpp
+++ b/noncore/unsupported/mailit/emaillistitem.cpp
@@ -38,7 +38,8 @@ EmailListItem::EmailListItem(QListView *parent, Email mailIn, bool inbox)
38 setText(0, temp); 38 setText(0, temp);
39 } 39 }
40 setText(1, mail.subject); 40 setText(1, mail.subject);
41 setText(2,mail.date); 41 // setText(2,mail.date);
42 setText(2,dateFromULCString(mail.date));
42 43
43 if (mailIn.files.count()>0) 44 if (mailIn.files.count()>0)
44 { 45 {
@@ -97,3 +98,61 @@ void EmailListItem::paintCell( QPainter *p, const QColorGroup &cg,
97 98
98 _cg.setColor( QColorGroup::Text, c ); 99 _cg.setColor( QColorGroup::Text, c );
99} 100}
101
102/*
103 * Converts an E-Mail date (ULC) RFC 2822 conform to a QDateTime.
104 * Returning a QString with formatting of "YYYY-MM-DD HH:MM:SS"
105 * (zodiac: This method was tested with more than 300 inbox mails,
106 * it didn't slow down the loading of mail-it.)
107 */
108QString EmailListItem::dateFromULCString( QString ulcDate )
109{
110 QString sTemp, sTime;
111 int iPos, iDay, iMon=1, iYear;
112
113 iPos=ulcDate.find(',');
114 if (iPos) { // it has a day-of-week
115 ulcDate=ulcDate.remove(0,++iPos); //.stripWhiteSpace();
116 }
117
118 QStringList dateEntries = QStringList::split(" ",ulcDate,FALSE);
119 QStringList::Iterator iter = dateEntries.begin();
120
121 // Get day as DD
122 iDay = (*iter++).toInt();
123
124 // Get month as string Mmm
125 sTemp = (*iter++);
126 if (sTemp =="Jan") {iMon=1;} else
127 if (sTemp =="Feb") {iMon=2;} else
128 if (sTemp =="Mar") {iMon=3;} else
129 if (sTemp =="Apr") {iMon=4;} else
130 if (sTemp =="May") {iMon=5;} else
131 if (sTemp =="Jun") {iMon=6;} else
132 if (sTemp =="Jul") {iMon=7;} else
133 if (sTemp =="Aug") {iMon=8;} else
134 if (sTemp =="Sep") {iMon=9;} else
135 if (sTemp =="Oct") {iMon=10;} else
136 if (sTemp =="Nov") {iMon=11;} else
137 if (sTemp =="Dec") {iMon=12;}
138
139 // Get year as YYYY or YY
140 iYear = (*iter++).toInt();
141
142 QDate date = QDate(iYear, iMon, iDay);
143
144 // Convert timestring into a QTime
145 QStringList timeEntries = QStringList::split(":",(*iter++),FALSE);
146 QStringList::Iterator iterTime = timeEntries.begin();
147 iYear=(*iterTime++).toInt(); // var reuse.. *cough*
148 iMon=(*iterTime++).toInt();
149 iDay=(*iterTime++).toInt();
150 QTime time = QTime(iYear,iMon,iDay);
151
152 return QString::number(date.year())+"-"
153 +QString::number(date.month()).rightJustify(2,'0')+"-"
154 +QString::number(date.day()).rightJustify(2,'0')+" "
155 +time.toString();
156}
157
158
diff --git a/noncore/unsupported/mailit/emaillistitem.h b/noncore/unsupported/mailit/emaillistitem.h
index 642932c..129a774 100644
--- a/noncore/unsupported/mailit/emaillistitem.h
+++ b/noncore/unsupported/mailit/emaillistitem.h
@@ -39,6 +39,7 @@ protected:
39private: 39private:
40 Email mail; 40 Email mail;
41 bool selected; 41 bool selected;
42 QString dateFromULCString( QString ulc );
42}; 43};
43 44
44#endif 45#endif
diff --git a/noncore/unsupported/mailit/mailit.pro b/noncore/unsupported/mailit/mailit.pro
index 5e9a83a..0224886 100644
--- a/noncore/unsupported/mailit/mailit.pro
+++ b/noncore/unsupported/mailit/mailit.pro
@@ -1,6 +1,5 @@
1TEMPLATE = app
2TARGET = mailit 1TARGET = mailit
3CONFIG = qt warn_on release 2CONFIG = qt warn_on release quick-app
4HEADERS = emailclient.h \ 3HEADERS = emailclient.h \
5 emailhandler.h \ 4 emailhandler.h \
6 emaillistitem.h \ 5 emaillistitem.h \
@@ -37,9 +36,6 @@ INCLUDEPATH += $(OPIEDIR)/include
37DEPENDPATH += $(OPIEDIR)/include 36DEPENDPATH += $(OPIEDIR)/include
38LIBS += -lqpe -lopie 37LIBS += -lqpe -lopie
39# -lssl 38# -lssl
40MOC_DIR=qpeobj
41OBJECTS_DIR=qpeobj
42DESTDIR=$(OPIEDIR)/bin
43 39
44TRANSLATIONS = ../../../i18n/de/mailit.ts \ 40TRANSLATIONS = ../../../i18n/de/mailit.ts \
45 ../../../i18n/nl/mailit.ts \ 41 ../../../i18n/nl/mailit.ts \
diff --git a/noncore/unsupported/mailit/mailitwindow.h b/noncore/unsupported/mailit/mailitwindow.h
index e818d32..11e56b9 100644
--- a/noncore/unsupported/mailit/mailitwindow.h
+++ b/noncore/unsupported/mailit/mailitwindow.h
@@ -33,6 +33,7 @@ class MailItWindow: public QMainWindow
33{ 33{
34 Q_OBJECT 34 Q_OBJECT
35public: 35public:
36 static QString appName() { return QString::fromLatin1("mailit"); }
36 MailItWindow(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); 37 MailItWindow(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
37 ~MailItWindow(); 38 ~MailItWindow();
38 39
diff --git a/noncore/unsupported/mailit/main.cpp b/noncore/unsupported/mailit/main.cpp
index 3a3e1fc..71f8877 100644
--- a/noncore/unsupported/mailit/main.cpp
+++ b/noncore/unsupported/mailit/main.cpp
@@ -20,10 +20,6 @@
20#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include "mailitwindow.h" 21#include "mailitwindow.h"
22 22
23int main(int argc, char* argv[]) 23#include <opie/oapplicationfactory.h>
24{ 24
25 QPEApplication a( argc, argv ); 25OPIE_EXPORT_APP( OApplicationFactory<MailItWindow> ) \ No newline at end of file
26 MailItWindow mw(0, 0);
27 a.showMainDocumentWidget(&mw);
28 return a.exec();
29}