|
|
|
@ -57,7 +57,7 @@ ResourceNet::ResourceNet( const KConfig *config )
|
|
|
|
|
if ( config ) {
|
|
|
|
|
init( KURL( config->readPathEntry( "NetUrl" ) ), config->readEntry( "NetFormat" ) );
|
|
|
|
|
} else {
|
|
|
|
|
init( KURL(), "vcard" );
|
|
|
|
|
init( KURL(), QString("vcard").latin1() );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -81,7 +81,7 @@ void ResourceNet::init( const KURL &url, const QString &format )
|
|
|
|
|
FormatFactory *factory = FormatFactory::self();
|
|
|
|
|
mFormat = factory->format( mFormatName );
|
|
|
|
|
if ( !mFormat ) {
|
|
|
|
|
mFormatName = "vcard";
|
|
|
|
|
mFormatName = QString("vcard").latin1();
|
|
|
|
|
mFormat = factory->format( mFormatName );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -177,6 +177,7 @@ bool ResourceNet::asyncLoad()
|
|
|
|
|
|
|
|
|
|
bool ok = createLocalTempFile();
|
|
|
|
|
if ( ok )
|
|
|
|
|
mTempFile->sync();
|
|
|
|
|
ok = mTempFile->close();
|
|
|
|
|
|
|
|
|
|
if ( !ok ) {
|
|
|
|
@ -237,6 +238,7 @@ bool ResourceNet::save( Ticket* )
|
|
|
|
|
|
|
|
|
|
if ( tempFile.status() == 0 && tempFile.file() ) {
|
|
|
|
|
saveToFile( tempFile.file() );
|
|
|
|
|
tempFile.sync();
|
|
|
|
|
ok = tempFile.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -268,6 +270,7 @@ bool ResourceNet::asyncSave( Ticket* )
|
|
|
|
|
bool ok = createLocalTempFile();
|
|
|
|
|
if ( ok ) {
|
|
|
|
|
saveToFile( mTempFile->file() );
|
|
|
|
|
mTempFile->sync();
|
|
|
|
|
ok = mTempFile->close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -348,7 +351,7 @@ void ResourceNet::downloadFinished( KIO::Job* )
|
|
|
|
|
d->mIsLoading = false;
|
|
|
|
|
|
|
|
|
|
if ( !hasTempFile() || mTempFile->status() != 0 ) {
|
|
|
|
|
d->mLastErrorString = i18n( "Download failed in some way!" );
|
|
|
|
|
d->mLastErrorString = i18n( "Download failed: Unable to create temporary file" );
|
|
|
|
|
QTimer::singleShot( 0, this, SLOT( signalError() ) );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|