Commit dfc45760 authored by jhammen's avatar jhammen
Browse files

update project list when renaming or deleting files

parent 7e3db546
......@@ -382,6 +382,8 @@ void MainWindow::on_actionDeleteFile_triggered() {
// remove from tree
FolderTreeItem *item = static_cast<FolderTreeItem *>(findTreeItem(path));
item->parent()->removeChild(item);
// remove from project
projectList.currentProject().closeFile(path);
// remove editor if any
delete findEditor(path);
// remove file from filesystem
......@@ -532,9 +534,13 @@ void MainWindow::on_actionRenameFile_triggered() {
if (item) {
item->parent()->removeChild(item);
}
ui->folderTree->clearSelection();
// update project
Project &project = projectList.currentProject();
project.closeFile(oldPath);
project.openFile(path);
// add new to tree if possible
QTreeWidgetItem *parent = findTreeItem(fileInfo.path());
ui->folderTree->clearSelection();
if (parent) {
FolderTreeItem *newItem =
new FolderTreeItem(parent, fileInfo.fileName(), fileInfo.filePath());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment