-rw-r--r-- | noncore/apps/checkbook/mainwindow.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp index d9e2047..8e2e2e3 100644 --- a/noncore/apps/checkbook/mainwindow.cpp +++ b/noncore/apps/checkbook/mainwindow.cpp | |||
@@ -242,8 +242,9 @@ void MainWindow::slotEdit() | |||
242 | 242 | ||
243 | // --- openBook --------------------------------------------------------------- | 243 | // --- openBook --------------------------------------------------------------- |
244 | void MainWindow::openBook(QListViewItem *curritem) | 244 | void MainWindow::openBook(QListViewItem *curritem) |
245 | { | 245 | { |
246 | if ( !curritem ) return; | ||
246 | // find book in List | 247 | // find book in List |
247 | QString currname=curritem->text(posName); | 248 | QString currname=curritem->text(posName); |
248 | CBInfo *cb = checkbooks->first(); | 249 | CBInfo *cb = checkbooks->first(); |
249 | while ( cb ) { | 250 | while ( cb ) { |
@@ -276,12 +277,10 @@ void MainWindow::openBook(QListViewItem *curritem) | |||
276 | QString newname = cb->name(); | 277 | QString newname = cb->name(); |
277 | if ( currname != newname ) | 278 | if ( currname != newname ) |
278 | { | 279 | { |
279 | // Update name if changed | 280 | // Update name if changed |
280 | if( curritem ) { | 281 | curritem->setText( posName, newname ); |
281 | curritem->setText( posName, newname ); | 282 | cbList->sort(); |
282 | cbList->sort(); | ||
283 | } | ||
284 | _cfg.setLastBook( newname ); | 283 | _cfg.setLastBook( newname ); |
285 | 284 | ||
286 | // Remove old file | 285 | // Remove old file |
287 | QFile f( tempFilename ); | 286 | QFile f( tempFilename ); |