author | drw <drw> | 2002-11-02 01:29:30 (UTC) |
---|---|---|
committer | drw <drw> | 2002-11-02 01:29:30 (UTC) |
commit | bf9388acdebf6e55345dff3bd1cd652b45a2202a (patch) (unidiff) | |
tree | 737ca55c9a30a1dde3aa289fd99cac7e4c30a3f7 /noncore/apps/checkbook/mainwindow.cpp | |
parent | 6e9225388baa9dfac4ed09f22189cfa98a610d39 (diff) | |
download | opie-bf9388acdebf6e55345dff3bd1cd652b45a2202a.zip opie-bf9388acdebf6e55345dff3bd1cd652b45a2202a.tar.gz opie-bf9388acdebf6e55345dff3bd1cd652b45a2202a.tar.bz2 |
Code updates/fixes
Diffstat (limited to 'noncore/apps/checkbook/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/mainwindow.cpp | 11 |
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 | |||
@@ -128,36 +128,41 @@ void MainWindow::slotEdit() | |||
128 | { | 128 | { |
129 | QString currname = cbList->currentText(); | 129 | QString currname = cbList->currentText(); |
130 | Checkbook *currcb = new Checkbook( this, currname, cbDir, currencySymbol ); | 130 | Checkbook *currcb = new Checkbook( this, currname, cbDir, currencySymbol ); |
131 | currcb->showMaximized(); | 131 | currcb->showMaximized(); |
132 | if ( currcb->exec() == QDialog::Accepted ) | 132 | if ( currcb->exec() == QDialog::Accepted ) |
133 | { | 133 | { |
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; |
147 | } | 150 | } |
148 | } | 151 | } |
149 | 152 | ||
150 | void MainWindow::slotDelete() | 153 | void 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() ); |
162 | } | 167 | } |
163 | } | 168 | } |