diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-12-05 23:20:00 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-12-05 23:20:00 +0000 |
commit | 68c97b0cf0927d8296ad76e3a70cab6ad2071dd2 (patch) | |
tree | af39391e9c8ab7c2a128e11a4a2afaccf36c5f9b /textedit.cpp | |
parent | fix broken cut/copy/paste actions (diff) | |
download | gpg4usb-68c97b0cf0927d8296ad76e3a70cab6ad2071dd2.tar.gz gpg4usb-68c97b0cf0927d8296ad76e3a70cab6ad2071dd2.zip |
fix crashes on closing help tab and exit with open help tabs
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@658 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'textedit.cpp')
-rw-r--r-- | textedit.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/textedit.cpp b/textedit.cpp index e189754..83dc676 100644 --- a/textedit.cpp +++ b/textedit.cpp @@ -213,6 +213,10 @@ void TextEdit::removeTab(int index) bool TextEdit::maybeSaveCurrentTab(bool askToSave) { EditorPage *page = curPage(); + // if this page is no textedit, there should be nothing to save + if(page == 0) { + return true; + } QTextDocument *document = page->getTextPage()->document(); if (document->isModified()) { @@ -438,7 +442,7 @@ QHash<int, QString> TextEdit::unsavedDocuments() { for(int i=0; i < tabWidget->count(); i++) { EditorPage *ep = qobject_cast<EditorPage *> (tabWidget->widget(i)); - if(ep->getTextPage()->document()->isModified()) { + if(ep != 0 && ep->getTextPage()->document()->isModified()) { QString docname = tabWidget->tabText(i); // remove * before name of modified doc docname.remove(0,2); |