author | zautrix <zautrix> | 2005-03-26 17:26:28 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-26 17:26:28 (UTC) |
commit | 36dd498ad2f5a2cf43fc08c621669fe42198e5eb (patch) (unidiff) | |
tree | 78f826bd02a35e0624d245f267ec5b595350574e /kmicromail | |
parent | e3f00322eb77bd03250eb66a2574b640de9aebb4 (diff) | |
download | kdepimpi-36dd498ad2f5a2cf43fc08c621669fe42198e5eb.zip kdepimpi-36dd498ad2f5a2cf43fc08c621669fe42198e5eb.tar.gz kdepimpi-36dd498ad2f5a2cf43fc08c621669fe42198e5eb.tar.bz2 |
fix
-rw-r--r-- | kmicromail/accountview.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index e9be224..6227f6d 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp | |||
@@ -58,96 +58,98 @@ void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) | |||
58 | void AccountView::populate( QList<Account> list ) | 58 | void AccountView::populate( QList<Account> list ) |
59 | { | 59 | { |
60 | clear(); | 60 | clear(); |
61 | 61 | ||
62 | imapAccounts.clear(); | 62 | imapAccounts.clear(); |
63 | mhAccounts.clear(); | 63 | mhAccounts.clear(); |
64 | 64 | ||
65 | mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); | 65 | mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); |
66 | 66 | ||
67 | Account *it; | 67 | Account *it; |
68 | for ( it = list.first(); it; it = list.next() ) | 68 | for ( it = list.first(); it; it = list.next() ) |
69 | { | 69 | { |
70 | if ( it->getType() == MAILLIB::A_IMAP ) | 70 | if ( it->getType() == MAILLIB::A_IMAP ) |
71 | { | 71 | { |
72 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); | 72 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); |
73 | imapAccounts.append(new IMAPviewItem( imap, this )); | 73 | imapAccounts.append(new IMAPviewItem( imap, this )); |
74 | } | 74 | } |
75 | else if ( it->getType() == MAILLIB::A_POP3 ) | 75 | else if ( it->getType() == MAILLIB::A_POP3 ) |
76 | { | 76 | { |
77 | POP3account *pop3 = static_cast<POP3account *>(it); | 77 | POP3account *pop3 = static_cast<POP3account *>(it); |
78 | /* must not be hold 'cause it isn't required */ | 78 | /* must not be hold 'cause it isn't required */ |
79 | (void) new POP3viewItem( pop3, this ); | 79 | (void) new POP3viewItem( pop3, this ); |
80 | } | 80 | } |
81 | else if ( it->getType() == MAILLIB::A_NNTP ) | 81 | else if ( it->getType() == MAILLIB::A_NNTP ) |
82 | { | 82 | { |
83 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); | 83 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); |
84 | /* must not be hold 'cause it isn't required */ | 84 | /* must not be hold 'cause it isn't required */ |
85 | (void) new NNTPviewItem( nntp, this ); | 85 | (void) new NNTPviewItem( nntp, this ); |
86 | } | 86 | } |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | void AccountView::refresh(QListViewItem *item) | 90 | void AccountView::refresh(QListViewItem *item) |
91 | { | 91 | { |
92 | if ( item ) | 92 | if ( item ) |
93 | { | 93 | { |
94 | m_currentItem = item; | 94 | m_currentItem = item; |
95 | QValueList<RecMailP> headerlist; | 95 | QValueList<RecMailP> headerlist; |
96 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 96 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
97 | view->refresh(headerlist); | 97 | view->refresh(headerlist); |
98 | emit refreshMailview(headerlist); | 98 | emit refreshMailview(headerlist); |
99 | } | 99 | } |
100 | } | 100 | } |
101 | void AccountView::refreshOutgoing() | 101 | void AccountView::refreshOutgoing() |
102 | { | 102 | { |
103 | m_currentItem = currentItem(); | 103 | m_currentItem = currentItem(); |
104 | if ( !m_currentItem ) return; | 104 | if ( !m_currentItem ) return; |
105 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | 105 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); |
106 | if ( !view->getFolder() ) | ||
107 | return; | ||
106 | QString bName = view->getFolder()->getDisplayName(); | 108 | QString bName = view->getFolder()->getDisplayName(); |
107 | if (bName.startsWith("/")&&bName.length()>1) | 109 | if (bName.startsWith("/")&&bName.length()>1) |
108 | { | 110 | { |
109 | bName.replace(0,1,""); | 111 | bName.replace(0,1,""); |
110 | } | 112 | } |
111 | int pos = bName.findRev("/"); | 113 | int pos = bName.findRev("/"); |
112 | if (pos > 0) | 114 | if (pos > 0) |
113 | { | 115 | { |
114 | bName.replace(0,pos+1,""); | 116 | bName.replace(0,pos+1,""); |
115 | } | 117 | } |
116 | //qDebug("name *%s* ",bName.lower().latin1() ); | 118 | //qDebug("name *%s* ",bName.lower().latin1() ); |
117 | if ( bName.lower() == "outgoing" || bName.lower() == "sent" || bName.lower() == "sendfailed" ) { | 119 | if ( bName.lower() == "outgoing" || bName.lower() == "sent" || bName.lower() == "sendfailed" ) { |
118 | refreshCurrent(); | 120 | refreshCurrent(); |
119 | // qDebug("refresh "); | 121 | // qDebug("refresh "); |
120 | } | 122 | } |
121 | } | 123 | } |
122 | 124 | ||
123 | void AccountView::refreshCurrent() | 125 | void AccountView::refreshCurrent() |
124 | { | 126 | { |
125 | m_currentItem = currentItem(); | 127 | m_currentItem = currentItem(); |
126 | if ( !m_currentItem ) return; | 128 | if ( !m_currentItem ) return; |
127 | QValueList<RecMailP> headerlist; | 129 | QValueList<RecMailP> headerlist; |
128 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | 130 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); |
129 | view->refresh(headerlist); | 131 | view->refresh(headerlist); |
130 | emit refreshMailview(headerlist); | 132 | emit refreshMailview(headerlist); |
131 | } | 133 | } |
132 | 134 | ||
133 | void AccountView::refreshAll() | 135 | void AccountView::refreshAll() |
134 | { | 136 | { |
135 | } | 137 | } |
136 | 138 | ||
137 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) | 139 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) |
138 | { | 140 | { |
139 | QListViewItem*item = selectedItem (); | 141 | QListViewItem*item = selectedItem (); |
140 | if (!item) return new RecBody(); | 142 | if (!item) return new RecBody(); |
141 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 143 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
142 | return view->fetchBody(aMail); | 144 | return view->fetchBody(aMail); |
143 | } | 145 | } |
144 | 146 | ||
145 | void AccountView::setupFolderselect(Selectstore*sels) | 147 | void AccountView::setupFolderselect(Selectstore*sels) |
146 | { | 148 | { |
147 | 149 | ||
148 | #ifndef DESKTOP_VERSION | 150 | #ifndef DESKTOP_VERSION |
149 | sels->showMaximized(); | 151 | sels->showMaximized(); |
150 | #else | 152 | #else |
151 | sels->show(); | 153 | sels->show(); |
152 | #endif | 154 | #endif |
153 | QStringList sFolders; | 155 | QStringList sFolders; |