-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 1 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 1 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.h | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 110583f..ae667ec 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -730,48 +730,49 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t | |||
730 | { | 730 | { |
731 | if (!body || current_recursion>=10) { | 731 | if (!body || current_recursion>=10) { |
732 | return; | 732 | return; |
733 | } | 733 | } |
734 | switch (body->bd_type) { | 734 | switch (body->bd_type) { |
735 | case MAILIMAP_BODY_1PART: | 735 | case MAILIMAP_BODY_1PART: |
736 | { | 736 | { |
737 | QValueList<int>countlist = recList; | 737 | QValueList<int>countlist = recList; |
738 | countlist.append(current_count); | 738 | countlist.append(current_count); |
739 | RecPartP currentPart = new RecPart(); | 739 | RecPartP currentPart = new RecPart(); |
740 | mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; | 740 | mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; |
741 | QString id(""); | 741 | QString id(""); |
742 | currentPart->setPositionlist(countlist); | 742 | currentPart->setPositionlist(countlist); |
743 | for (unsigned int j = 0; j < countlist.count();++j) { | 743 | for (unsigned int j = 0; j < countlist.count();++j) { |
744 | id+=(j>0?" ":""); | 744 | id+=(j>0?" ":""); |
745 | id+=QString("%1").arg(countlist[j]); | 745 | id+=QString("%1").arg(countlist[j]); |
746 | } | 746 | } |
747 | //odebug << "ID = " << id.latin1() << "" << oendl; | 747 | //odebug << "ID = " << id.latin1() << "" << oendl; |
748 | currentPart->setIdentifier(id); | 748 | currentPart->setIdentifier(id); |
749 | fillSinglePart(currentPart,part1); | 749 | fillSinglePart(currentPart,part1); |
750 | /* important: Check for is NULL 'cause a body can be empty! | 750 | /* important: Check for is NULL 'cause a body can be empty! |
751 | And we put it only into the mail if it is the FIRST part */ | 751 | And we put it only into the mail if it is the FIRST part */ |
752 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { | 752 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { |
753 | QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); | 753 | QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); |
754 | //qDebug("encoding %d text %s ",currentPart->Encoding().latin1(), body_text.latin1() ); | ||
754 | target_body->setDescription(currentPart); | 755 | target_body->setDescription(currentPart); |
755 | target_body->setBodytext(body_text); | 756 | target_body->setBodytext(body_text); |
756 | if (countlist.count()>1) { | 757 | if (countlist.count()>1) { |
757 | target_body->addPart(currentPart); | 758 | target_body->addPart(currentPart); |
758 | } | 759 | } |
759 | } else { | 760 | } else { |
760 | target_body->addPart(currentPart); | 761 | target_body->addPart(currentPart); |
761 | } | 762 | } |
762 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_MSG) { | 763 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_MSG) { |
763 | traverseBody(mail,part1->bd_data.bd_type_msg->bd_body,target_body,current_recursion+1,countlist); | 764 | traverseBody(mail,part1->bd_data.bd_type_msg->bd_body,target_body,current_recursion+1,countlist); |
764 | } | 765 | } |
765 | } | 766 | } |
766 | break; | 767 | break; |
767 | case MAILIMAP_BODY_MPART: | 768 | case MAILIMAP_BODY_MPART: |
768 | { | 769 | { |
769 | QValueList<int>countlist = recList; | 770 | QValueList<int>countlist = recList; |
770 | clistcell*current=0; | 771 | clistcell*current=0; |
771 | mailimap_body*current_body=0; | 772 | mailimap_body*current_body=0; |
772 | unsigned int ccount = 1; | 773 | unsigned int ccount = 1; |
773 | mailimap_body_type_mpart*mailDescription = body->bd_data.bd_body_mpart; | 774 | mailimap_body_type_mpart*mailDescription = body->bd_data.bd_body_mpart; |
774 | for (current=clist_begin(mailDescription->bd_list);current!=0;current=clist_next(current)) { | 775 | for (current=clist_begin(mailDescription->bd_list);current!=0;current=clist_next(current)) { |
775 | current_body = (mailimap_body*)current->data; | 776 | current_body = (mailimap_body*)current->data; |
776 | if (current_body->bd_type==MAILIMAP_BODY_MPART) { | 777 | if (current_body->bd_type==MAILIMAP_BODY_MPART) { |
777 | RecPartP targetPart = new RecPart(); | 778 | RecPartP targetPart = new RecPart(); |
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 40b5591..5d2c0ad 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp | |||
@@ -1,48 +1,49 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <qdir.h> | 2 | #include <qdir.h> |
3 | 3 | ||
4 | //#include <opie2/odebug.h> | 4 | //#include <opie2/odebug.h> |
5 | #include <kconfig.h> | 5 | #include <kconfig.h> |
6 | 6 | ||
7 | #include <kstandarddirs.h> | 7 | #include <kstandarddirs.h> |
8 | #include "settings.h" | 8 | #include "settings.h" |
9 | //#include "defines.h" | 9 | //#include "defines.h" |
10 | 10 | ||
11 | #define IMAP_PORT "143" | 11 | #define IMAP_PORT "143" |
12 | #define IMAP_SSL_PORT "993" | 12 | #define IMAP_SSL_PORT "993" |
13 | #define SMTP_PORT "25" | 13 | #define SMTP_PORT "25" |
14 | #define SMTP_SSL_PORT "465" | 14 | #define SMTP_SSL_PORT "465" |
15 | #define POP3_PORT "110" | 15 | #define POP3_PORT "110" |
16 | #define POP3_SSL_PORT "995" | 16 | #define POP3_SSL_PORT "995" |
17 | #define NNTP_PORT "119" | 17 | #define NNTP_PORT "119" |
18 | #define NNTP_SSL_PORT "563" | 18 | #define NNTP_SSL_PORT "563" |
19 | 19 | ||
20 | 20 | ||
21 | Settings::Settings() | 21 | Settings::Settings() |
22 | : QObject() | 22 | : QObject() |
23 | { | 23 | { |
24 | updateAccounts(); | 24 | updateAccounts(); |
25 | //qDebug("++++++++++++++++++new settings "); | ||
25 | } | 26 | } |
26 | 27 | ||
27 | void Settings::checkDirectory() | 28 | void Settings::checkDirectory() |
28 | { | 29 | { |
29 | return; | 30 | return; |
30 | locateLocal("data", "kopiemail" ); | 31 | locateLocal("data", "kopiemail" ); |
31 | /* | 32 | /* |
32 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { | 33 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { |
33 | system( "mkdir -p $HOME/Applications/opiemail" ); | 34 | system( "mkdir -p $HOME/Applications/opiemail" ); |
34 | qDebug("$HOME/Applications/opiemail created "); | 35 | qDebug("$HOME/Applications/opiemail created "); |
35 | } | 36 | } |
36 | */ | 37 | */ |
37 | } | 38 | } |
38 | 39 | ||
39 | QList<Account> Settings::getAccounts() | 40 | QList<Account> Settings::getAccounts() |
40 | { | 41 | { |
41 | return accounts; | 42 | return accounts; |
42 | } | 43 | } |
43 | 44 | ||
44 | void Settings::addAccount( Account *account ) | 45 | void Settings::addAccount( Account *account ) |
45 | { | 46 | { |
46 | accounts.append( account ); | 47 | accounts.append( account ); |
47 | } | 48 | } |
48 | 49 | ||
diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h index 79567ef..c996fe0 100644 --- a/kmicromail/libmailwrapper/settings.h +++ b/kmicromail/libmailwrapper/settings.h | |||
@@ -144,38 +144,39 @@ public: | |||
144 | 144 | ||
145 | virtual void read(); | 145 | virtual void read(); |
146 | virtual void save(); | 146 | virtual void save(); |
147 | virtual QString getFileName(); | 147 | virtual QString getFileName(); |
148 | 148 | ||
149 | void setLogin( bool b ) { login = b; } | 149 | void setLogin( bool b ) { login = b; } |
150 | bool getLogin() { return login; } | 150 | bool getLogin() { return login; } |
151 | 151 | ||
152 | void setGroups( QStringList list ) { subscribedGroups = list; } | 152 | void setGroups( QStringList list ) { subscribedGroups = list; } |
153 | QStringList getGroups() { return subscribedGroups; } | 153 | QStringList getGroups() { return subscribedGroups; } |
154 | 154 | ||
155 | private: | 155 | private: |
156 | QString file; | 156 | QString file; |
157 | bool login; | 157 | bool login; |
158 | QStringList subscribedGroups; | 158 | QStringList subscribedGroups; |
159 | 159 | ||
160 | }; | 160 | }; |
161 | 161 | ||
162 | class Settings : public QObject | 162 | class Settings : public QObject |
163 | { | 163 | { |
164 | Q_OBJECT | 164 | Q_OBJECT |
165 | 165 | ||
166 | public: | 166 | public: |
167 | Settings(); | 167 | Settings(); |
168 | //~Settings(){qDebug("-------------------settings "); }; | ||
168 | QList<Account> getAccounts(); | 169 | QList<Account> getAccounts(); |
169 | void addAccount(Account *account); | 170 | void addAccount(Account *account); |
170 | void delAccount(Account *account); | 171 | void delAccount(Account *account); |
171 | void saveAccounts(); | 172 | void saveAccounts(); |
172 | void readAccounts(); | 173 | void readAccounts(); |
173 | static void checkDirectory(); | 174 | static void checkDirectory(); |
174 | 175 | ||
175 | private: | 176 | private: |
176 | void updateAccounts(); | 177 | void updateAccounts(); |
177 | QList<Account> accounts; | 178 | QList<Account> accounts; |
178 | 179 | ||
179 | }; | 180 | }; |
180 | 181 | ||
181 | #endif | 182 | #endif |