author | zautrix <zautrix> | 2005-03-30 11:55:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-30 11:55:53 (UTC) |
commit | b5222dd7a607f78235b1ea39fea0f95a9c08ccd3 (patch) (side-by-side diff) | |
tree | 4e4d334ae9d8805b7718c1610bd84af128fd8151 /kabc/plugins | |
parent | 597cad3a63e6c22855704bf8435db70e3c2b184f (diff) | |
download | kdepimpi-b5222dd7a607f78235b1ea39fea0f95a9c08ccd3.zip kdepimpi-b5222dd7a607f78235b1ea39fea0f95a9c08ccd3.tar.gz kdepimpi-b5222dd7a607f78235b1ea39fea0f95a9c08ccd3.tar.bz2 |
fixes
-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 41 | ||||
-rw-r--r-- | kabc/plugins/file/resourcefile.h | 2 |
2 files changed, 30 insertions, 13 deletions
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index dc5932f..4ab7f02 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp @@ -56,5 +56,4 @@ $Id$ - using namespace KABC; @@ -99,4 +98,7 @@ ResourceFile::ResourceFile( const QString &fileName , { // qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1()); + + + init( fileName, formatName ); } @@ -119,4 +121,19 @@ void ResourceFile::init( const QString &fileName, const QString &formatName ) connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); #endif + + + QString localKdeDir; + localKdeDir = readEnvPath("LOCALMICROKDEHOME"); + if ( ! localKdeDir.isEmpty() ) { + qDebug("LOCALMICROKDEHOME is set to: %s",localKdeDir.latin1() ); + + + + + } + qDebug("RESOURCE: %s ", fileName.latin1()); + + + setFileName( fileName ); } @@ -134,5 +151,5 @@ void ResourceFile::writeConfig( KConfig *config ) Resource::writeConfig( config ); - config->writeEntry( "FileName", mFileName ); + config->writeEntry( "FileName", fileName() ); config->writeEntry( "FileFormat", mFormatName ); @@ -159,6 +176,6 @@ Ticket *ResourceFile::requestSaveTicket() bool ResourceFile::doOpen() { - QFile file( mFileName ); - qDebug("ResourceFile::openfile %s ", mFileName.latin1()); + QFile file( fileName() ); + qDebug("ResourceFile::openfile %s ", fileName().latin1()); if ( !file.exists() ) { @@ -192,7 +209,7 @@ bool ResourceFile::load() { - QFile file( mFileName ); + QFile file( fileName() ); if ( !file.open( IO_ReadOnly ) ) { - addressBook()->error( i18n( "Unable to open file '%1'." ).arg( mFileName ) ); + addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) ); return false; } @@ -230,5 +247,5 @@ bool ResourceFile::save( Ticket *ticket ) #endif QFile info; - info.setName( mFileName ); + info.setName( fileName() ); bool ok = info.open( IO_WriteOnly ); if ( ok ) { @@ -243,5 +260,5 @@ bool ResourceFile::save( Ticket *ticket ) if ( !ok ) - addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) ); + addressBook()->error( i18n( "Unable to save file '%1'." ).arg( fileName() ) ); #ifndef NO_DIRWATCH mDirWatch.startScan(); @@ -335,5 +352,5 @@ void ResourceFile::setFileName( const QString &fileName ) mDirWatch.startScan(); #else - mFileName = fileName; + mFileName2 = fileName; #endif @@ -344,5 +361,5 @@ void ResourceFile::setFileName( const QString &fileName ) QString ResourceFile::fileName() const { - return mFileName; + return mFileName2; } @@ -383,5 +400,5 @@ void ResourceFile::fileChanged() - QString text( i18n( "File resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( mFileName ) ); + QString text( i18n( "File resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( fileName() ) ); if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) { load(); @@ -399,5 +416,5 @@ void ResourceFile::removeAddressee( const Addressee &addr ) void ResourceFile::cleanUp() { - unlock( mFileName ); + unlock( fileName() ); } diff --git a/kabc/plugins/file/resourcefile.h b/kabc/plugins/file/resourcefile.h index b4421b2..dd38a9d 100644 --- a/kabc/plugins/file/resourcefile.h +++ b/kabc/plugins/file/resourcefile.h @@ -148,5 +148,5 @@ protected: private: - QString mFileName; + QString mFileName2; QString mFormatName; |