Commit 31685ad9 authored by Mehrdad Momeny's avatar Mehrdad Momeny

Fixed a crash on exit

svn path=/trunk/KDE/kdepim/blogilo/; revision=1197956
parent c1cd051f
......@@ -139,10 +139,12 @@ bool MainWindow::queryExit()
if( !DBMan::self()->clearTempEntries() )
kDebug()<<"Could not erase temp_post table: "<< DBMan::self()->lastErrorText();
int count = tabPosts->count();
toolbox->getFieldsValue(activePost->currentPost());
for(int i =0; i<count; ++i) {
PostEntry* pst = qobject_cast<PostEntry*>(tabPosts->widget(i));
DBMan::self()->saveTempEntry(*pst->currentPost(), pst->currentPostBlogId());
if(count > 0) {
toolbox->getFieldsValue(activePost->currentPost());
for(int i =0; i<count; ++i) {
PostEntry* pst = qobject_cast<PostEntry*>(tabPosts->widget(i));
DBMan::self()->saveTempEntry(*pst->currentPost(), pst->currentPostBlogId());
}
}
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment