Skip to content

Commit

Permalink
GUI: Delete tree after closing a directory to prevent duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
fdde authored and DrMcCoy committed Dec 29, 2017
1 parent a1d9d77 commit f2fc498
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ void MainWindow::open(const QString &path) {
return;
}

_treeModel = new ResourceTree(this, _treeView);

// enters populate thread in here
_treeModel->populate(_files.getRoot());

Expand Down Expand Up @@ -303,6 +305,9 @@ void MainWindow::slotCloseDir() {

_treeView->setModel(nullptr);

delete _treeModel;
_treeModel = nullptr;

_log->append(tr("Closed directory: %1").arg(_rootPath));

_rootPath = "";
Expand Down

0 comments on commit f2fc498

Please sign in to comment.