| 220 | } |
| 221 | |
| 222 | void TabBar::removeTab(const QString &fileName, bool silent) |
| 223 | { |
| 224 | int index = indexOf(fileName); |
| 225 | if (-1 == index) |
| 226 | return; |
| 227 | |
| 228 | if (!silent && QFile::exists(fileName) && d->isModified(index)) { |
| 229 | int ret = d->showConfirmDialog(fileName); |
| 230 | if (ret == 0) // save |
| 231 | emit saveFileRequested(fileName); |
| 232 | else if (ret == 2 || ret == -1) // cancel or close |
| 233 | return; |
| 234 | } |
| 235 | |
| 236 | emit tabClosed(fileName); |
| 237 | editor.fileClosed(fileName); |
| 238 | d->tabBar->removeTab(index); |
| 239 | editor.switchedFile(this->currentFileName()); |
| 240 | } |
| 241 | |
| 242 | void TabBar::closeAllTab(const QStringList &exceptList, bool silent) |
| 243 | { |
no test coverage detected