-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index af76558..2bd9e71 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp | |||
@@ -188,33 +188,33 @@ Ticket *ResourceFile::requestSaveTicket() | |||
188 | bool ResourceFile::doOpen() | 188 | bool ResourceFile::doOpen() |
189 | { | 189 | { |
190 | QFile file( fileName() ); | 190 | QFile file( fileName() ); |
191 | qDebug("ResourceFile::openfile %s ", fileName().latin1()); | 191 | qDebug("ResourceFile::openfile %s ", fileName().latin1()); |
192 | 192 | ||
193 | if ( !file.exists() ) { | 193 | if ( !file.exists() ) { |
194 | // try to create the file | 194 | // try to create the file |
195 | bool ok = file.open( IO_WriteOnly ); | 195 | bool ok = file.open( IO_WriteOnly ); |
196 | if ( ok ) | 196 | if ( ok ) |
197 | file.close(); | 197 | file.close(); |
198 | 198 | ||
199 | return ok; | 199 | return ok; |
200 | } else { | 200 | } else { |
201 | if ( !file.open( IO_ReadWrite ) ) | 201 | if ( !file.open( IO_ReadWrite ) ) |
202 | return false; | 202 | return false; |
203 | 203 | ||
204 | if ( file.size() == 0 ) { | 204 | if ( file.size() < 10 ) { |
205 | file.close(); | 205 | file.close(); |
206 | return true; | 206 | return true; |
207 | } | 207 | } |
208 | 208 | ||
209 | bool ok = mFormat->checkFormat( &file ); | 209 | bool ok = mFormat->checkFormat( &file ); |
210 | file.close(); | 210 | file.close(); |
211 | 211 | ||
212 | return ok; | 212 | return ok; |
213 | } | 213 | } |
214 | } | 214 | } |
215 | 215 | ||
216 | void ResourceFile::doClose() | 216 | void ResourceFile::doClose() |
217 | { | 217 | { |
218 | } | 218 | } |
219 | 219 | ||
220 | bool ResourceFile::load() | 220 | bool ResourceFile::load() |