| 1510 | } |
| 1511 | |
| 1512 | void MainWindow::moveFileToTrash(ScintillaNext *editor) |
| 1513 | { |
| 1514 | Q_ASSERT(editor->isFile()); |
| 1515 | |
| 1516 | const QString filePath = editor->getFilePath(); |
| 1517 | auto reply = QMessageBox::question(this, tr("Delete File"), tr("Are you sure you want to move <b>%1</b> to the trash?").arg(filePath)); |
| 1518 | |
| 1519 | if (reply == QMessageBox::Yes) { |
| 1520 | if (editor->moveToTrash()) { |
| 1521 | closeCurrentFile(); |
| 1522 | |
| 1523 | // Since the file no longer exists, specifically remove it from the recent files list |
| 1524 | app->getRecentFilesListManager()->removeFile(editor->getFilePath()); |
| 1525 | } |
| 1526 | else { |
| 1527 | QMessageBox::warning(this, tr("Error Deleting File"), tr("Something went wrong deleting <b>%1</b>?").arg(filePath)); |
| 1528 | } |
| 1529 | } |
| 1530 | } |
| 1531 | |
| 1532 | void MainWindow::print() |
| 1533 | { |
nothing calls this directly
no test coverage detected