Allow Qt to cleanup its signals.

test
cc9cii 10 years ago
parent a836446d22
commit f326b14604

@ -69,7 +69,7 @@ void CSMDoc::DocumentManager::removeDocument (CSMDoc::Document *document)
throw std::runtime_error ("removing invalid document"); throw std::runtime_error ("removing invalid document");
mDocuments.erase (iter); mDocuments.erase (iter);
delete document; document->deleteLater();
if (mDocuments.empty()) if (mDocuments.empty())
emit lastDocumentDeleted(); emit lastDocumentDeleted();

@ -32,10 +32,6 @@ void CSVDoc::View::closeEvent (QCloseEvent *event)
event->ignore(); event->ignore();
else else
{ {
// delete the subviews first
for (QList<CSVDoc::SubView *>::iterator iter = mSubViews.begin(); iter != mSubViews.end(); ++iter)
delete *iter;
// closeRequest() returns true if last document // closeRequest() returns true if last document
mViewManager.removeDocAndView(mDocument); mViewManager.removeDocAndView(mDocument);
} }
@ -98,7 +94,7 @@ void CSVDoc::View::setupEditMenu()
QAction *search = new QAction (tr ("Search"), this); QAction *search = new QAction (tr ("Search"), this);
connect (search, SIGNAL (triggered()), this, SLOT (addSearchSubView())); connect (search, SIGNAL (triggered()), this, SLOT (addSearchSubView()));
edit->addAction (search); edit->addAction (search);
} }
void CSVDoc::View::setupViewMenu() void CSVDoc::View::setupViewMenu()

Loading…
Cancel
Save