[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepimlibs
From: Jaison Lee <lee.jaison () gmail ! com>
Date: 2006-10-16 0:53:36
Message-ID: 1160960016.075432.23604.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 595883 by jlee:
Port to new KSaveFile.
M +3 -4 kabc/plugins/file/resourcefile.cpp
M +4 -5 kcal/icalformat.cpp
M +3 -4 ktnef/ktnefparser.cpp
--- trunk/KDE/kdepimlibs/kabc/plugins/file/resourcefile.cpp #595882:595883
@@ -309,14 +309,13 @@
KSaveFile saveFile( mFileName );
bool ok = false;
- if ( saveFile.status() == 0 && saveFile.file() )
+ if ( saveFile.open() )
{
- mFormat->saveAll( addressBook(), this, saveFile.file() );
- ok = saveFile.close();
+ mFormat->saveAll( addressBook(), this, &saveFile );
+ ok = saveFile.finalize();
}
if ( !ok ) {
- saveFile.abort();
addressBook()->error( i18n( "Unable to save file '%1'." , mFileName ) );
}
--- trunk/KDE/kdepimlibs/kcal/icalformat.cpp #595882:595883
@@ -112,9 +112,8 @@
KSaveFile::backupFile( fileName );
KSaveFile file( fileName );
- if ( file.status() != 0 ) {
- kDebug(5800) << "ICalFormat::save() errno: " << strerror( file.status() )
- << endl;
+ if ( !file.open() ) {
+ kDebug(5800) << "ICalFormat::save() err: " << file.errorString() << endl;
setException( new ErrorFormat( ErrorFormat::SaveError,
i18n( "Error saving to '%1'.", fileName ) ) );
return false;
@@ -122,9 +121,9 @@
// Convert to UTF8 and save
QByteArray textUtf8 = text.toUtf8();
- file.file()->write( textUtf8.data(), textUtf8.size() - 1 );
+ file.write( textUtf8.data(), textUtf8.size() - 1 );
- if ( !file.close() ) {
+ if ( !file.finalize() ) {
setException(new ErrorFormat(ErrorFormat::SaveError,
i18n("Could not save '%1'", fileName)));
return false;
--- trunk/KDE/kdepimlibs/ktnef/ktnefparser.cpp #595882:595883
@@ -441,9 +441,8 @@
if ( !d->device_->seek( att->offset() ) ) {
return false;
}
- KSaveFile saveFile( filename );
- QFile *outfile = saveFile.file();
- if ( !outfile ) {
+ KSaveFile outfile( filename );
+ if ( !outfile.open() ) {
return false;
}
@@ -457,7 +456,7 @@
ok = false;
} else {
len -= n;
- if ( outfile->write( buf, n ) != n ) {
+ if ( outfile.write( buf, n ) != n ) {
ok = false;
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic