move project files to the trash instead of deleting

This commit is contained in:
T1ti
2023-03-19 22:12:42 +01:00
parent 77de6a9c10
commit 13fc8bdada

View File

@@ -6,6 +6,7 @@
#include <filesystem>
#include <QString>
#include <QFile>
#include <noggit/ui/FontNoggit.hpp>
#include "ui_NoggitProjectSelectionWindow.h"
@@ -189,9 +190,13 @@ void NoggitProjectSelectionWindow::handleContextMenuProjectListItemDelete(std::s
switch (prompt.buttonRole(prompt.clickedButton()))
{
case QMessageBox::AcceptRole:
{
Component::RecentProjectsComponent::registerProjectRemove(project_path);
std::filesystem::remove_all(project_path);
// std::filesystem::remove_all(project_path);
QFile folder(project_path.c_str());
folder.moveToTrash();
break;
}
case QMessageBox::DestructiveRole:
default:
break;