author | ulf69 <ulf69> | 2004-06-29 06:43:11 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-06-29 06:43:11 (UTC) |
commit | 627489ea2669d3997676bc3cee0f5d0d0c16c4d4 (patch) (side-by-side diff) | |
tree | 022c32ccbb485458dc3c8887388aa4c5aa1eae59 /kabc/stdaddressbook.cpp | |
parent | 2d5b376ae1329d82d1ce1947b972b30866abff9b (diff) | |
download | kdepimpi-627489ea2669d3997676bc3cee0f5d0d0c16c4d4.zip kdepimpi-627489ea2669d3997676bc3cee0f5d0d0c16c4d4.tar.gz kdepimpi-627489ea2669d3997676bc3cee0f5d0d0c16c4d4.tar.bz2 |
*** empty log message ***
-rw-r--r-- | kabc/stdaddressbook.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp index 8faaaef..144a9dc 100644 --- a/kabc/stdaddressbook.cpp +++ b/kabc/stdaddressbook.cpp @@ -1,131 +1,137 @@ /* This file is part of libkabc. Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Enhanced Version of the file for platform independent KDE tools. Copyright (c) 2004 Ulf Schenk $Id$ */ /*US #include <stdlib.h> #include <kapplication.h> #include <kcrash.h> #include <ksimpleconfig.h> */ +#ifndef DESKTOP_VERSION +#include <qpe/global.h> +#else +#include <qdir.h> +#endif + #include "resource.h" #include <kresources/manager.h> #include <kdebug.h> #include <klocale.h> #include <kstaticdeleter.h> #include <kstandarddirs.h> #include "stdaddressbook.h" using namespace KABC; StdAddressBook *StdAddressBook::mSelf = 0; bool StdAddressBook::mAutomaticSave = true; static KStaticDeleter<StdAddressBook> addressBookDeleter; QString StdAddressBook::fileName() { return locateLocal( "data", "kabc/std.vcf" ); } QString StdAddressBook::directoryName() { return locateLocal( "data", "kabc/stdvcf" ); } void StdAddressBook::handleCrash() { StdAddressBook::self()->cleanUp(); } StdAddressBook *StdAddressBook::self() { if ( !mSelf ) { QString appdir = StdAddressBook::setTempAppDir(); kdDebug(5700) << "StdAddressBook::self()" << endl; // US im am not sure why I have to use the other format here?? #ifdef KAB_EMBEDDED mSelf = addressBookDeleter.setObject( new StdAddressBook ); #else //KAB_EMBEDDED addressBookDeleter.setObject( mSelf, new StdAddressBook ); #endif //KAB_EMBEDDED KStandardDirs::setAppDir( appdir ); } return mSelf; } QString StdAddressBook::setTempAppDir() { QString appDIR = KStandardDirs::appDir(); #ifdef DESKTOP_VERSION QString appdir = QDir::homeDirPath(); if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) appdir += "kaddressbook/"; else appdir += "/kaddressbook/"; KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); #else KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) ); #endif return appDIR; } StdAddressBook *StdAddressBook::self( bool onlyFastResources ) { if ( !mSelf ) { QString appdir =StdAddressBook::setTempAppDir(); #ifdef KAB_EMBEDDED mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) ); #else //KAB_EMBEDDED addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) ); #endif //KAB_EMBEDDED KStandardDirs::setAppDir( appdir ); } return mSelf; } StdAddressBook::StdAddressBook() //US : AddressBook( "kabcrc" ) : AddressBook( locateLocal( "config", "kabcrc") ) { init( false ); } StdAddressBook::StdAddressBook( bool onlyFastResources ) //US : AddressBook( "kabcrc" ) : AddressBook( locateLocal( "config", "kabcrc") ) { |