summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/apps/checkbook/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/mainwindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp
index ce15e3e..c7ffa7c 100644
--- a/noncore/apps/checkbook/mainwindow.cpp
+++ b/noncore/apps/checkbook/mainwindow.cpp
@@ -184,25 +184,26 @@ void MainWindow::buildList()
184 184
185void MainWindow::addCheckbook( CBInfo *cb ) 185void MainWindow::addCheckbook( CBInfo *cb )
186{ 186{
187 QListViewItem *lvi = new QListViewItem( cbList ); 187 QListViewItem *lvi = new QListViewItem( cbList );
188 if ( _cfg.getShowLocks() && !cb->password().isNull() ) 188 if ( _cfg.getShowLocks() && !cb->password().isNull() )
189 { 189 {
190 lvi->setPixmap( 0, lockIcon ); 190 lvi->setPixmap( 0, lockIcon );
191 } 191 }
192 lvi->setText( posName, cb->name() ); 192 lvi->setText( posName, cb->name() );
193 if ( _cfg.getShowBalances() ) 193 if ( _cfg.getShowBalances() )
194 { 194 {
195 QString balance; 195 QString balance;
196 balance.sprintf( "%s%.2f", _cfg.getCurrencySymbol().latin1(), cb->balance() ); 196 balance.sprintf( "%.2f", cb->balance() );
197 balance.prepend( _cfg.getCurrencySymbol() );
197 lvi->setText( posName + 1, balance ); 198 lvi->setText( posName + 1, balance );
198 } 199 }
199} 200}
200 201
201void MainWindow::buildFilename( const QString &name ) 202void MainWindow::buildFilename( const QString &name )
202{ 203{
203 tempFilename = cbDir; 204 tempFilename = cbDir;
204 tempFilename.append( name ); 205 tempFilename.append( name );
205 tempFilename.append( ".qcb" ); 206 tempFilename.append( ".qcb" );
206} 207}
207 208
208void MainWindow::slotNew() 209void MainWindow::slotNew()
@@ -295,25 +296,26 @@ void MainWindow::openBook(QListViewItem *curritem)
295 if ( _cfg.getShowLocks() && !cb->password().isNull() != currlock ) 296 if ( _cfg.getShowLocks() && !cb->password().isNull() != currlock )
296 { 297 {
297 if ( !cb->password().isNull() ) 298 if ( !cb->password().isNull() )
298 curritem->setPixmap( 0, lockIcon ); 299 curritem->setPixmap( 0, lockIcon );
299 else 300 else
300 curritem->setPixmap( 0, nullIcon ); 301 curritem->setPixmap( 0, nullIcon );
301 } 302 }
302 303
303 // Update balance if changed 304 // Update balance if changed
304 if ( _cfg.getShowBalances() && cb->balance() != currbalance ) 305 if ( _cfg.getShowBalances() && cb->balance() != currbalance )
305 { 306 {
306 QString tempstr; 307 QString tempstr;
307 tempstr.sprintf( "%s%.2f", _cfg.getCurrencySymbol().latin1(), cb->balance() ); 308 tempstr.sprintf( "%.2f", cb->balance() );
309 tempstr.prepend( _cfg.getCurrencySymbol() );
308 curritem->setText( posName + 1, tempstr ); 310 curritem->setText( posName + 1, tempstr );
309 } 311 }
310 312
311 // write config, if needed 313 // write config, if needed
312 if( _cfg.isDirty() ) { 314 if( _cfg.isDirty() ) {
313 Config config("checkbook"); 315 Config config("checkbook");
314 _cfg.writeConfig( config ); 316 _cfg.writeConfig( config );
315 } 317 }
316 } 318 }
317 delete currcb; 319 delete currcb;
318} 320}
319 321