From b5222dd7a607f78235b1ea39fea0f95a9c08ccd3 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 30 Mar 2005 11:55:53 +0000 Subject: fixes --- diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp index aa96210..9118c3d 100644 --- a/kabc/addresseeview.cpp +++ b/kabc/addresseeview.cpp @@ -295,7 +295,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) } else { static bool setDefaultImage = false; if ( !setDefaultImage ) { - qDebug("Setting default pixmap "); + //qDebug("Setting default pixmap "); QMimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) ); setDefaultImage = true; } 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 @@ -55,7 +55,6 @@ $Id$ //#define ALLOW_LOCKING - using namespace KABC; extern "C" @@ -98,6 +97,9 @@ ResourceFile::ResourceFile( const QString &fileName , : Resource( 0 ) { // qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1()); + + + init( fileName, formatName ); } @@ -118,6 +120,21 @@ void ResourceFile::init( const QString &fileName, const QString &formatName ) connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); 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 ); } @@ -133,7 +150,7 @@ void ResourceFile::writeConfig( KConfig *config ) config->setGroup( "Resource_" + identifier() ); Resource::writeConfig( config ); - config->writeEntry( "FileName", mFileName ); + config->writeEntry( "FileName", fileName() ); config->writeEntry( "FileFormat", mFormatName ); // qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1()); @@ -158,8 +175,8 @@ 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() ) { // try to create the file @@ -191,9 +208,9 @@ void ResourceFile::doClose() 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; } @@ -229,7 +246,7 @@ bool ResourceFile::save( Ticket *ticket ) mDirWatch.stopScan(); #endif QFile info; - info.setName( mFileName ); + info.setName( fileName() ); bool ok = info.open( IO_WriteOnly ); if ( ok ) { mFormat->saveAll( addressBook(), this, &info ); @@ -242,7 +259,7 @@ 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(); #endif @@ -334,7 +351,7 @@ void ResourceFile::setFileName( const QString &fileName ) mDirWatch.addFile( mFileName ); mDirWatch.startScan(); #else - mFileName = fileName; + mFileName2 = fileName; #endif //US simulate KDirWatch event @@ -343,7 +360,7 @@ void ResourceFile::setFileName( const QString &fileName ) QString ResourceFile::fileName() const { - return mFileName; + return mFileName2; } void ResourceFile::setFormat( const QString &format ) @@ -382,7 +399,7 @@ void ResourceFile::fileChanged() return; - QString text( i18n( "File resource '%1'
has been changed by third party.
Do you want to reload?").arg( mFileName ) ); + QString text( i18n( "File resource '%1'
has been changed by third party.
Do you want to reload?").arg( fileName() ) ); if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) { load(); addressBook()->emitAddressBookChanged(); @@ -398,7 +415,7 @@ void ResourceFile::removeAddressee( const Addressee &addr ) void ResourceFile::cleanUp() { - unlock( mFileName ); + unlock( fileName() ); } //US #include "resourcefile.moc" 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 @@ -147,7 +147,7 @@ protected: void unlock( const QString &fileName ); private: - QString mFileName; + QString mFileName2; QString mFormatName; FormatPlugin *mFormat; diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp index d182279..2d97c8c 100644 --- a/microkde/kdatetbl.cpp +++ b/microkde/kdatetbl.cpp @@ -324,7 +324,7 @@ KDateTable::setFontSize(int size) #endif if ( maxCell.width() * 1000 / maxCell.height() > 1900 ) { maxCell.setHeight(maxCell.width() * 1000 / 1900 ); - qDebug("setmax "); + //qDebug("setmax "); } } diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index 810c889..4ab1a68 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp @@ -1203,7 +1203,7 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode) } -static QString readEnvPath(const char *env) +QString readEnvPath(const char *env) { //#ifdef _WIN32_ // return ""; @@ -1306,6 +1306,8 @@ void KStandardDirs::addKDEDefaults() localKdeDir = qApp->applicationDirPath () + "/"+ localKdeDir.mid( 6 ); #endif qDebug("Using local conf dir %s ",localKdeDir.latin1() ); + // + setenv( "LOCALMICROKDEHOME", localKdeDir.latin1(), 1 ); } #endif } diff --git a/microkde/kdecore/kstandarddirs.h b/microkde/kdecore/kstandarddirs.h index bee864e..901384e 100644 --- a/microkde/kdecore/kstandarddirs.h +++ b/microkde/kdecore/kstandarddirs.h @@ -647,6 +647,7 @@ public: * \endcode **/ + /*! * \relates KStandardDirs * This function is just for convenience. It simply calls @@ -676,6 +677,9 @@ QString locateLocal( const char *type, const QString& filename /*US , const KIns **/ QString locateLocal( const char *type, const QString& filename, bool createDir /*US , const KInstance* instance = KGlobal::instance() */); +QString readEnvPath(const char *env); + + /*! @} */ #endif // SSK_KSTDDIRS_H -- cgit v0.9.0.2