Fix duplicate items in menubar

* When recreating the Results window, the menubar had duplicate items added each time.
* Removing the underlying C++ object is apparently enough to fix the issue.
* SetParent(None) can still be used in case of floating windows
This commit is contained in:
glubsy 2020-08-31 21:17:08 +02:00
parent 4a1641e39d
commit 584e9c92d9
1 changed files with 2 additions and 1 deletions

View File

@ -366,7 +366,8 @@ class DupeGuru(QObject):
self.details_dialog.setParent(None)
if self.resultWindow is not None:
self.resultWindow.close()
self.resultWindow.setParent(None)
# This is better for tabs, as it takes care of duplicate items in menu bar
self.resultWindow.deleteLater() if self.use_tabs else self.resultWindow.setParent(None)
if self.use_tabs:
self.resultWindow = self.main_window.createPage(
"ResultWindow", parent=self.main_window, app=self)