Diffstat (limited to 'noncore/net/mail/accountview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 7938d4f..297f553 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -98,80 +98,80 @@ void AccountView::refresh(QListViewItem *item) | |||
98 | view->refresh(headerlist); | 98 | view->refresh(headerlist); |
99 | emit refreshMailview(&headerlist); | 99 | emit refreshMailview(&headerlist); |
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 | ||
103 | void AccountView::refreshCurrent() | 103 | void AccountView::refreshCurrent() |
104 | { | 104 | { |
105 | m_currentItem = currentItem(); | 105 | m_currentItem = currentItem(); |
106 | if ( !m_currentItem ) return; | 106 | if ( !m_currentItem ) return; |
107 | QList<RecMail> headerlist; | 107 | QList<RecMail> headerlist; |
108 | headerlist.setAutoDelete(true); | 108 | headerlist.setAutoDelete(true); |
109 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | 109 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); |
110 | view->refresh(headerlist); | 110 | view->refresh(headerlist); |
111 | emit refreshMailview(&headerlist); | 111 | emit refreshMailview(&headerlist); |
112 | } | 112 | } |
113 | 113 | ||
114 | void AccountView::refreshAll() | 114 | void AccountView::refreshAll() |
115 | { | 115 | { |
116 | } | 116 | } |
117 | 117 | ||
118 | RecBody AccountView::fetchBody(const RecMail&aMail) | 118 | RecBody AccountView::fetchBody(const RecMail&aMail) |
119 | { | 119 | { |
120 | QListViewItem*item = selectedItem (); | 120 | QListViewItem*item = selectedItem (); |
121 | if (!item) return RecBody(); | 121 | if (!item) return RecBody(); |
122 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 122 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
123 | return view->fetchBody(aMail); | 123 | return view->fetchBody(aMail); |
124 | } | 124 | } |
125 | 125 | ||
126 | void AccountView::setupFolderselect(Selectstore*sels) | 126 | void AccountView::setupFolderselect(Selectstore*sels) |
127 | { | 127 | { |
128 | QPEApplication::showDialog( sels ); | 128 | QPEApplication::showDialog( sels ); |
129 | QStringList sFolders; | 129 | QStringList sFolders; |
130 | unsigned int i = 0; | 130 | unsigned int i = 0; |
131 | for (i=0; i < mhAccounts.count();++i) | 131 | for (i=0; i < mhAccounts.count();++i) |
132 | { | 132 | { |
133 | mhAccounts[i]->refresh(false); | 133 | mhAccounts[i]->refresh(false); |
134 | sFolders = mhAccounts[i]->subFolders(); | 134 | sFolders = mhAccounts[i]->subFolders(); |
135 | sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); | 135 | sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); |
136 | } | 136 | } |
137 | for (i=0; i < imapAccounts.count();++i) | 137 | for (i=0; i < imapAccounts.count();++i) |
138 | { | 138 | { |
139 | if (imapAccounts[i]->offline()) | 139 | if (imapAccounts[i]->offline()) |
140 | continue; | 140 | continue; |
141 | imapAccounts[i]->refreshFolders(false); | 141 | imapAccounts[i]->refreshFolders(false); |
142 | sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); | 142 | sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); |
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | void AccountView::downloadMails(Folder*fromFolder,AbstractMail*fromWrapper) | 146 | void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) |
147 | { | 147 | { |
148 | AbstractMail*targetMail = 0; | 148 | AbstractMail*targetMail = 0; |
149 | QString targetFolder = ""; | 149 | QString targetFolder = ""; |
150 | Selectstore sels; | 150 | Selectstore sels; |
151 | setupFolderselect(&sels); | 151 | setupFolderselect(&sels); |
152 | if (!sels.exec()) return; | 152 | if (!sels.exec()) return; |
153 | targetMail = sels.currentMail(); | 153 | targetMail = sels.currentMail(); |
154 | targetFolder = sels.currentFolder(); | 154 | targetFolder = sels.currentFolder(); |
155 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || | 155 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || |
156 | targetFolder.isEmpty()) | 156 | targetFolder.isEmpty()) |
157 | { | 157 | { |
158 | return; | 158 | return; |
159 | } | 159 | } |
160 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 160 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
161 | { | 161 | { |
162 | QMessageBox::critical(0,tr("Error creating new Folder"), | 162 | QMessageBox::critical(0,tr("Error creating new Folder"), |
163 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | 163 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |
164 | return; | 164 | return; |
165 | } | 165 | } |
166 | qDebug("Targetfolder: %s",targetFolder.latin1()); | 166 | qDebug("Targetfolder: %s",targetFolder.latin1()); |
167 | qDebug("Fromfolder: %s",fromFolder->getName().latin1()); | 167 | qDebug("Fromfolder: %s",fromFolder->getName().latin1()); |
168 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails()); | 168 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails()); |
169 | refreshCurrent(); | 169 | refreshCurrent(); |
170 | } | 170 | } |
171 | 171 | ||
172 | bool AccountView::currentisDraft() | 172 | bool AccountView::currentisDraft() |
173 | { | 173 | { |
174 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); | 174 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); |
175 | if (!view) return false; | 175 | if (!view) return false; |
176 | return view->isDraftfolder(); | 176 | return view->isDraftfolder(); |
177 | } | 177 | } |