From 056f171723a9301aea5a65340dffeda34e078abf Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 30 Mar 2005 13:24:56 +0000 Subject: fixes --- (limited to 'kabc/plugins/file/resourcefile.cpp') diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index 4ab7f02..0e6c2a3 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp @@ -126,16 +126,22 @@ void ResourceFile::init( const QString &fileName, const QString &formatName ) localKdeDir = readEnvPath("LOCALMICROKDEHOME"); if ( ! localKdeDir.isEmpty() ) { qDebug("LOCALMICROKDEHOME is set to: %s",localKdeDir.latin1() ); - - - + QFileInfo fi ( fileName ); + QString localname = localKdeDir + "/apps/kabc/" + fi.fileName (); + QFileInfo fi2 ( localname ); + if ( ! fi2.exists() ) { + KMessageBox::error(0,i18n("Addressbook resource file not found:\n '%1'.\nIn LOCAL mode only resource files in\n'%2'\nare supported.\n(i.e. in the dir ./apps/kabc/ relative to the kapi(.exe) binary.)\n\nIf you are starting KA/Pi for the very first time\nyou will get this error message as well.\nIt will create the missing file automatically for you.").arg(localname).arg(localKdeDir+"/apps/kabc/") ); + setFileName( localname ); + return; + + } else { + qDebug("Local resource file found. Changing filename to: %s",localname.latin1() ); + setFileName( localname ); + return; + } } - qDebug("RESOURCE: %s ", fileName.latin1()); - - - - setFileName( fileName ); + setFileName( fileName ); } ResourceFile::~ResourceFile() -- cgit v0.9.0.2