-rw-r--r-- | noncore/unsupported/mail2/folderwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/unsupported/mail2/folderwidget.cpp b/noncore/unsupported/mail2/folderwidget.cpp index ca2bb5a..6c36e92 100644 --- a/noncore/unsupported/mail2/folderwidget.cpp +++ b/noncore/unsupported/mail2/folderwidget.cpp | |||
@@ -128,97 +128,97 @@ FolderWidgetItem *FolderWidget::addFolder(Folder &folder, FolderWidgetItem *fold | |||
128 | return new FolderWidgetItem(folder, folderWidgetItem); | 128 | return new FolderWidgetItem(folder, folderWidgetItem); |
129 | } | 129 | } |
130 | 130 | ||
131 | void FolderWidget::slotMenuActivated(int itemid) | 131 | void FolderWidget::slotMenuActivated(int itemid) |
132 | { | 132 | { |
133 | if (currentItem() == NULL) { | 133 | if (currentItem() == NULL) { |
134 | QMessageBox::information(this, tr("Error"), tr("<p>Please select an item first.</p>"), tr("Ok")); | 134 | QMessageBox::information(this, tr("Error"), tr("<p>Please select an item first.</p>"), tr("Ok")); |
135 | return; | 135 | return; |
136 | } | 136 | } |
137 | 137 | ||
138 | if (itemid == MENU_RENAME) { | 138 | if (itemid == MENU_RENAME) { |
139 | if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return; | 139 | if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return; |
140 | 140 | ||
141 | Folder folder = ((FolderWidgetItem *)currentItem())->folder(); | 141 | Folder folder = ((FolderWidgetItem *)currentItem())->folder(); |
142 | QString newName = Rename::rename(folder.fullName(), this); | 142 | QString newName = Rename::rename(folder.fullName(), this); |
143 | if (newName.isNull()) return; | 143 | if (newName.isNull()) return; |
144 | 144 | ||
145 | folder.topFolder().handler()->iRename(folder.fullName(), newName); | 145 | folder.topFolder().handler()->iRename(folder.fullName(), newName); |
146 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPRename(IMAPResponse &))); | 146 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPRename(IMAPResponse &))); |
147 | } else if (itemid == MENU_DELETE) { | 147 | } else if (itemid == MENU_DELETE) { |
148 | if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return; | 148 | if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return; |
149 | 149 | ||
150 | Folder folder = ((FolderWidgetItem *)currentItem())->folder(); | 150 | Folder folder = ((FolderWidgetItem *)currentItem())->folder(); |
151 | 151 | ||
152 | int ret = QMessageBox::information(this, tr("Question"), tr("<p>Do you really want to delete <pre>%1</pre>?").arg(folder.fullName()), tr("Yes"), tr("No")); | 152 | int ret = QMessageBox::information(this, tr("Question"), tr("<p>Do you really want to delete <pre>%1</pre>?").arg(folder.fullName()), tr("Yes"), tr("No")); |
153 | if (ret == 1) return; | 153 | if (ret == 1) return; |
154 | 154 | ||
155 | _createFolder = folder; | 155 | _createFolder = folder; |
156 | 156 | ||
157 | folder.topFolder().handler()->iDelete(folder.fullName()); | 157 | folder.topFolder().handler()->iDelete(folder.fullName()); |
158 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPDelete(IMAPResponse &))); | 158 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPDelete(IMAPResponse &))); |
159 | } else if (itemid == MENU_MOVE) { | 159 | } else if (itemid == MENU_MOVE) { |
160 | 160 | ||
161 | } else if (itemid == MENU_COPY) { | 161 | } else if (itemid == MENU_COPY) { |
162 | 162 | ||
163 | } else if (itemid == MENU_CREATE) { | 163 | } else if (itemid == MENU_CREATE) { |
164 | Folder folder = (((FolderWidgetItem *)currentItem())->folder()); | 164 | Folder folder = (((FolderWidgetItem *)currentItem())->folder()); |
165 | _createFolder = folder; | 165 | _createFolder = folder; |
166 | 166 | ||
167 | QString folderName = Rename::getText(tr("Foldername"), tr("<p>Please enter the name of the new folder.</p>"), this); | 167 | QString folderName = Rename::getText(tr("Foldername"), tr("<p>Please enter the name of the new folder.</p>"), this); |
168 | if (folderName.isNull()) return; | 168 | if (folderName.isNull()) return; |
169 | 169 | ||
170 | folder.topFolder().handler()->iCreate(folder.fullName() + folder.separator() + folderName); | 170 | folder.topFolder().handler()->iCreate(folder.fullName() + folder.separator() + folderName); |
171 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPCreate(IMAPResponse &))); | 171 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPCreate(IMAPResponse &))); |
172 | } else if (itemid == MENU_RESCAN) { | 172 | } else if (itemid == MENU_RESCAN) { |
173 | Folder folder = (((FolderWidgetItem *)currentItem())->folder()); | 173 | Folder folder = (((FolderWidgetItem *)currentItem())->folder()); |
174 | _rescanAccount = folder.topFolder().account(); | 174 | _rescanAccount = folder.topFolder().account(); |
175 | 175 | ||
176 | folder.topFolder().handler()->iList(".", "*"); | 176 | folder.topFolder().handler()->iList("", "*"); |
177 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &))); | 177 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &))); |
178 | } | 178 | } |
179 | } | 179 | } |
180 | 180 | ||
181 | void FolderWidget::slotItemClicked(QListViewItem *item) | 181 | void FolderWidget::slotItemClicked(QListViewItem *item) |
182 | { | 182 | { |
183 | if (item == NULL) return; | 183 | if (item == NULL) return; |
184 | Folder folder = ((FolderWidgetItem *)item)->folder(); | 184 | Folder folder = ((FolderWidgetItem *)item)->folder(); |
185 | if (folder.fullName().isEmpty()) return; | 185 | if (folder.fullName().isEmpty()) return; |
186 | 186 | ||
187 | emit folderSelected(folder); | 187 | emit folderSelected(folder); |
188 | } | 188 | } |
189 | 189 | ||
190 | void FolderWidget::slotIMAPLookingUpHost() | 190 | void FolderWidget::slotIMAPLookingUpHost() |
191 | { | 191 | { |
192 | emit status(tr("Looking up host...")); | 192 | emit status(tr("Looking up host...")); |
193 | emit connecting(); | 193 | emit connecting(); |
194 | } | 194 | } |
195 | 195 | ||
196 | void FolderWidget::slotIMAPHostFound() | 196 | void FolderWidget::slotIMAPHostFound() |
197 | { | 197 | { |
198 | emit status(tr("Host found.")); | 198 | emit status(tr("Host found.")); |
199 | } | 199 | } |
200 | 200 | ||
201 | void FolderWidget::slotIMAPConnected() | 201 | void FolderWidget::slotIMAPConnected() |
202 | { | 202 | { |
203 | emit status(tr("Connected to host.")); | 203 | emit status(tr("Connected to host.")); |
204 | emit connected(); | 204 | emit connected(); |
205 | } | 205 | } |
206 | 206 | ||
207 | void FolderWidget::slotIMAPError(int error) | 207 | void FolderWidget::slotIMAPError(int error) |
208 | { | 208 | { |
209 | if (error == IMAPBase::IMAPErrConnectionRefused) { | 209 | if (error == IMAPBase::IMAPErrConnectionRefused) { |
210 | QMessageBox::warning(this, tr("Error"), tr("<p>The IMAP connection was refused.</p>"), tr("Ok")); | 210 | QMessageBox::warning(this, tr("Error"), tr("<p>The IMAP connection was refused.</p>"), tr("Ok")); |
211 | } else if (error == IMAPBase::IMAPErrHostNotFound) { | 211 | } else if (error == IMAPBase::IMAPErrHostNotFound) { |
212 | QMessageBox::warning(this, tr("Error"), tr("<p>The host was not found.</p>"), tr("Ok")); | 212 | QMessageBox::warning(this, tr("Error"), tr("<p>The host was not found.</p>"), tr("Ok")); |
213 | } else if (error == IMAPBase::IMAPErrSocketRead) { | 213 | } else if (error == IMAPBase::IMAPErrSocketRead) { |
214 | QMessageBox::warning(this, tr("Error"), tr("<p>There was an error while reading from the socket.</p>"), tr("Ok")); | 214 | QMessageBox::warning(this, tr("Error"), tr("<p>There was an error while reading from the socket.</p>"), tr("Ok")); |
215 | } else if (error == IMAPBase::IMAPErrLoginFailed) { | 215 | } else if (error == IMAPBase::IMAPErrLoginFailed) { |
216 | QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Check your password/username.</p>"), tr("Ok")); | 216 | QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Check your password/username.</p>"), tr("Ok")); |
217 | } else { | 217 | } else { |
218 | QMessageBox::warning(this, tr("Error"), tr("<p>An unknown error was encountered.</p>"), tr("Ok")); | 218 | QMessageBox::warning(this, tr("Error"), tr("<p>An unknown error was encountered.</p>"), tr("Ok")); |
219 | } | 219 | } |
220 | } | 220 | } |
221 | 221 | ||
222 | void FolderWidget::slotIMAPDisconnected() | 222 | void FolderWidget::slotIMAPDisconnected() |
223 | { | 223 | { |
224 | emit status(tr("Disconnected.")); | 224 | emit status(tr("Disconnected.")); |