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.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp
index ead17b4..2eb8396 100644
--- a/noncore/apps/checkbook/mainwindow.cpp
+++ b/noncore/apps/checkbook/mainwindow.cpp
@@ -134,13 +134,16 @@ void MainWindow::slotEdit()
134 QString newname = currcb->getName(); 134 QString newname = currcb->getName();
135 if ( currname != newname ) 135 if ( currname != newname )
136 { 136 {
137 cbList->changeItem( newname, cbList->currentItem() ); 137 cbList->changeItem( newname, cbList->currentItem() );
138 cbList->sort(); 138 cbList->sort();
139 139
140 QFile f( cbDir + currname + ".qcb" ); 140 QString tempstr = cbDir;
141 tempstr.append( currname );
142 tempstr.append( ".qcb" );
143 QFile f( tempstr );
141 if ( f.exists() ) 144 if ( f.exists() )
142 { 145 {
143 f.remove(); 146 f.remove();
144 } 147 }
145 } 148 }
146 delete currcb; 149 delete currcb;
@@ -148,14 +151,16 @@ void MainWindow::slotEdit()
148} 151}
149 152
150void MainWindow::slotDelete() 153void MainWindow::slotDelete()
151{ 154{
152 if ( QPEMessageBox::confirmDelete ( this, tr( "Delete checkbook" ), cbList->currentText() ) ) 155 if ( QPEMessageBox::confirmDelete ( this, tr( "Delete checkbook" ), cbList->currentText() ) )
153 { 156 {
154 QString name = cbDir + cbList->currentText() + ".qcb"; 157 QString tempstr = cbDir;
155 QFile f( name ); 158 tempstr.append( cbList->currentText() );
159 tempstr.append( ".qcb" );
160 QFile f( tempstr );
156 if ( f.exists() ) 161 if ( f.exists() )
157 { 162 {
158 f.remove(); 163 f.remove();
159 } 164 }
160 165
161 cbList->removeItem( cbList->currentItem() ); 166 cbList->removeItem( cbList->currentItem() );