Diffstat (limited to 'noncore/unsupported/mailit/emailclient.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/emailclient.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp index 2943986..6612541 100644 --- a/noncore/unsupported/mailit/emailclient.cpp +++ b/noncore/unsupported/mailit/emailclient.cpp | |||
@@ -14,43 +14,43 @@ | |||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qapplication.h> | 20 | #include <qapplication.h> |
21 | #include <qmessagebox.h> | 21 | #include <qmessagebox.h> |
22 | #include <qfile.h> | 22 | #include <qfile.h> |
23 | #include <qcheckbox.h> | 23 | #include <qcheckbox.h> |
24 | #include <qmenubar.h> | 24 | #include <qmenubar.h> |
25 | #include <qaction.h> | 25 | #include <qaction.h> |
26 | #include "resource.h" | 26 | #include <qpe/resource.h> |
27 | #include "emailclient.h" | 27 | #include "emailclient.h" |
28 | 28 | ||
29 | QCollection::Item AccountList::newItem(QCollection::Item d) | 29 | QCollection::Item AccountList::newItem(QCollection::Item d) |
30 | { | 30 | { |
31 | return dupl( (MailAccount *) d); | 31 | return dupl( (MailAccount *) d); |
32 | } | 32 | } |
33 | 33 | ||
34 | MailAccount* AccountList::dupl(MailAccount *in) | 34 | MailAccount* AccountList::dupl(MailAccount *in) |
35 | { | 35 | { |
36 | ac = new MailAccount(*in); | 36 | ac = new MailAccount(*in); |
37 | return ac; | 37 | return ac; |
38 | } | 38 | } |
39 | 39 | ||
40 | EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) | 40 | EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) |
41 | : QMainWindow( parent, name, fl ) | 41 | : QMainWindow( parent, name, fl ) |
42 | { | 42 | { |
43 | emailHandler = new EmailHandler(); | 43 | emailHandler = new EmailHandler(); |
44 | addressList = new AddressList( getPath(FALSE) + "mail_adr"); | 44 | addressList = new AddressList(); |
45 | 45 | ||
46 | sending = FALSE; | 46 | sending = FALSE; |
47 | receiving = FALSE; | 47 | receiving = FALSE; |
48 | previewingMail = FALSE; | 48 | previewingMail = FALSE; |
49 | mailIdCount = 1; | 49 | mailIdCount = 1; |
50 | accountIdCount = 1; | 50 | accountIdCount = 1; |
51 | allAccounts = FALSE; | 51 | allAccounts = FALSE; |
52 | 52 | ||
53 | init(); | 53 | init(); |
54 | 54 | ||
55 | connect(emailHandler, SIGNAL(mailSent()), this, SLOT(mailSent()) ); | 55 | connect(emailHandler, SIGNAL(mailSent()), this, SLOT(mailSent()) ); |
56 | 56 | ||
@@ -662,24 +662,30 @@ void EmailClient::readSettings() | |||
662 | 662 | ||
663 | account.lastServerMailCount = 0; | 663 | account.lastServerMailCount = 0; |
664 | account.synchronize = FALSE; | 664 | account.synchronize = FALSE; |
665 | if ( (pos = p->find("SYNCHRONIZE",':', accountPos, TRUE)) != -1) { | 665 | if ( (pos = p->find("SYNCHRONIZE",':', accountPos, TRUE)) != -1) { |
666 | if (p->getString(& ++pos, 'z', TRUE).upper() == "YES") { | 666 | if (p->getString(& ++pos, 'z', TRUE).upper() == "YES") { |
667 | account.synchronize = TRUE; | 667 | account.synchronize = TRUE; |
668 | if ( (pos = p->find("LASTSERVERMAILCOUNT",':', accountPos, TRUE)) != -1) { | 668 | if ( (pos = p->find("LASTSERVERMAILCOUNT",':', accountPos, TRUE)) != -1) { |
669 | s = p->getString(& ++pos, 'z', TRUE); | 669 | s = p->getString(& ++pos, 'z', TRUE); |
670 | account.lastServerMailCount = s.toInt(); | 670 | account.lastServerMailCount = s.toInt(); |
671 | } | 671 | } |
672 | } | 672 | } |
673 | } | 673 | } |
674 | |||
675 | if ( (pos = p->find("SYNCLIMIT",':', accountPos, TRUE)) != -1) { | ||
676 | account.syncLimit = p->getString(& ++pos, 'z', TRUE).toInt(); | ||
677 | } | ||
678 | |||
679 | |||
674 | accountList.append(&account); | 680 | accountList.append(&account); |
675 | } | 681 | } |
676 | delete p; | 682 | delete p; |
677 | } | 683 | } |
678 | mailconf->setGroup("mailitglobal"); | 684 | mailconf->setGroup("mailitglobal"); |
679 | if ( (y = mailconf->readNumEntry("mailidcount", -1)) != -1) { | 685 | if ( (y = mailconf->readNumEntry("mailidcount", -1)) != -1) { |
680 | mailIdCount = y; | 686 | mailIdCount = y; |
681 | } | 687 | } |
682 | if ( (y = mailconf->readNumEntry("accountidcount", -1)) != -1) { | 688 | if ( (y = mailconf->readNumEntry("accountidcount", -1)) != -1) { |
683 | accountIdCount = y; | 689 | accountIdCount = y; |
684 | } | 690 | } |
685 | } | 691 | } |
@@ -707,24 +713,26 @@ void EmailClient::saveSettings() | |||
707 | t << "POPUser: " + accountPtr->popUserName + "\n"; | 713 | t << "POPUser: " + accountPtr->popUserName + "\n"; |
708 | t << "POPPAssword: " + accountPtr->popPasswd + "\n"; | 714 | t << "POPPAssword: " + accountPtr->popPasswd + "\n"; |
709 | t << "POPServer: " + accountPtr->popServer + "\n"; | 715 | t << "POPServer: " + accountPtr->popServer + "\n"; |
710 | t << "SMTPServer: " + accountPtr->smtpServer + "\n"; | 716 | t << "SMTPServer: " + accountPtr->smtpServer + "\n"; |
711 | t << "AccountId: " << accountPtr->id << "\n"; | 717 | t << "AccountId: " << accountPtr->id << "\n"; |
712 | if (accountPtr->synchronize) { | 718 | if (accountPtr->synchronize) { |
713 | t << "Synchronize: Yes\n"; | 719 | t << "Synchronize: Yes\n"; |
714 | t << "LastServerMailCount: "; | 720 | t << "LastServerMailCount: "; |
715 | t << accountPtr->lastServerMailCount << "\n"; | 721 | t << accountPtr->lastServerMailCount << "\n"; |
716 | } else { | 722 | } else { |
717 | t << "Synchronize: No\n"; | 723 | t << "Synchronize: No\n"; |
718 | } | 724 | } |
725 | t << "SyncLimit: "; | ||
726 | t << accountPtr->syncLimit << "\n"; | ||
719 | t << "accountEnd;\n"; | 727 | t << "accountEnd;\n"; |
720 | } | 728 | } |
721 | f.close(); | 729 | f.close(); |
722 | 730 | ||
723 | mailconf->setGroup("mailitglobal"); | 731 | mailconf->setGroup("mailitglobal"); |
724 | mailconf->writeEntry("mailidcount", mailIdCount); | 732 | mailconf->writeEntry("mailidcount", mailIdCount); |
725 | mailconf->writeEntry("accountidcount", accountIdCount); | 733 | mailconf->writeEntry("accountidcount", accountIdCount); |
726 | } | 734 | } |
727 | 735 | ||
728 | void EmailClient::selectAccount(int id) | 736 | void EmailClient::selectAccount(int id) |
729 | { | 737 | { |
730 | if (accountList.count() > 0) { | 738 | if (accountList.count() > 0) { |