From 567562648299d8d035a71f172452868c7cd40237 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Tue, 9 Sep 2014 07:24:18 +1000 Subject: [PATCH] Cleanup signals when finished. --- apps/opencs/view/doc/filedialog.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/opencs/view/doc/filedialog.cpp b/apps/opencs/view/doc/filedialog.cpp index 2c6470784..8c6344bb5 100644 --- a/apps/opencs/view/doc/filedialog.cpp +++ b/apps/opencs/view/doc/filedialog.cpp @@ -115,7 +115,7 @@ void CSVDoc::FileDialog::buildOpenFileView() connect (mSelector, SIGNAL (signalAddonFileSelected (int)), this, SLOT (slotUpdateAcceptButton (int))); connect (mSelector, SIGNAL (signalAddonFileUnselected (int)), this, SLOT (slotUpdateAcceptButton (int))); - connect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotOpenFile()), Qt::UniqueConnection); + connect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotOpenFile())); } void CSVDoc::FileDialog::slotUpdateAcceptButton (int) @@ -162,6 +162,11 @@ void CSVDoc::FileDialog::slotRejected() void CSVDoc::FileDialog::slotNewFile() { emit signalCreateNewFile (mAdjusterWidget->getPath()); + + mFileWidget->disconnect(); + mSelector->disconnect(); + ui.projectButtonBox->disconnect(); + close(); } void CSVDoc::FileDialog::slotOpenFile() @@ -171,4 +176,8 @@ void CSVDoc::FileDialog::slotOpenFile() mAdjusterWidget->setName (file->filePath(), !file->isGameFile()); emit signalOpenFiles (mAdjusterWidget->getPath()); + + mSelector->disconnect(); + ui.projectButtonBox->disconnect(); + close(); }