MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / moveFileToTrash

Method moveFileToTrash

src/dialogs/MainWindow.cpp:1512–1530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1510}
1511
1512void 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
1532void MainWindow::print()
1533{

Callers

nothing calls this directly

Calls 5

isFileMethod · 0.80
getFilePathMethod · 0.80
moveToTrashMethod · 0.80
removeFileMethod · 0.80

Tested by

no test coverage detected