author | zautrix <zautrix> | 2005-04-04 11:29:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-04 11:29:55 (UTC) |
commit | 23db4aa99cb7a5feb540b6be578efaee8ec6ef80 (patch) (side-by-side diff) | |
tree | f60d08e53dc09cf8a9ca901697797de9cf5dc669 /kabc/plugins/file/resourcefile.cpp | |
parent | 69a388bdef8d4a31063f983735d2b7d25775f3cf (diff) | |
download | kdepimpi-23db4aa99cb7a5feb540b6be578efaee8ec6ef80.zip kdepimpi-23db4aa99cb7a5feb540b6be578efaee8ec6ef80.tar.gz kdepimpi-23db4aa99cb7a5feb540b6be578efaee8ec6ef80.tar.bz2 |
sync fixes
Diffstat (limited to 'kabc/plugins/file/resourcefile.cpp') (more/less context) (ignore whitespace changes)
-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 @@ -172,65 +172,65 @@ void ResourceFile::writeConfig( KConfig *config ) Ticket *ResourceFile::requestSaveTicket() { kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; if ( !addressBook() ) return 0; #ifdef ALLOW_LOCKING if ( !lock( mFileName ) ) { qDebug("unablt to lock file "); return 0; } #endif return createTicket( this ); } bool ResourceFile::doOpen() { QFile file( fileName() ); qDebug("ResourceFile::openfile %s ", fileName().latin1()); if ( !file.exists() ) { // try to create the file bool ok = file.open( IO_WriteOnly ); if ( ok ) file.close(); return ok; } else { if ( !file.open( IO_ReadWrite ) ) return false; - if ( file.size() == 0 ) { + if ( file.size() < 10 ) { file.close(); return true; } bool ok = mFormat->checkFormat( &file ); file.close(); return ok; } } void ResourceFile::doClose() { } bool ResourceFile::load() { QFile file( fileName() ); if ( !file.open( IO_ReadOnly ) ) { addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) ); return false; } // qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1()); return mFormat->loadAll( addressBook(), this, &file ); } bool ResourceFile::save( Ticket *ticket ) { // qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1()); |