KABC::ResourceFile Class Reference
This resource allows access to a local file. More...
#include <resourcefile.h>
Public Member Functions | |
ResourceFile (const KConfig *cfg) | |
ResourceFile (const QString &fileName, const QString &formatName="vcard") | |
~ResourceFile () | |
virtual void | writeConfig (KConfig *cfg) |
virtual bool | doOpen () |
virtual void | doClose () |
virtual Ticket * | requestSaveTicket () |
virtual void | releaseSaveTicket (Ticket *) |
virtual bool | load () |
virtual bool | asyncLoad () |
virtual bool | save (Ticket *ticket) |
virtual bool | asyncSave (Ticket *ticket) |
void | setFileName (const QString &) |
QString | fileName () const |
void | setFormat (const QString &name) |
QString | format () const |
virtual void | removeAddressee (const Addressee &addr) |
Protected Slots | |
void | fileChanged () |
Protected Member Functions | |
void | init (const QString &fileName, const QString &format) |
bool | lock (const QString &fileName) |
void | unlock (const QString &fileName) |
Detailed Description
This resource allows access to a local file.
Definition at line 48 of file resourcefile.h.
Constructor & Destructor Documentation
|
Constructor.
Definition at line 49 of file resourcefile.cpp. References KABC::StdAddressBook::fileName(), fileName(), KConfigBase::readEntry(), and KConfigBase::readPathEntry(). |
|
Construct file resource on file.
Definition at line 66 of file resourcefile.cpp. |
|
Destructor.
Definition at line 95 of file resourcefile.cpp. |
Member Function Documentation
|
Writes the config back.
Definition at line 103 of file resourcefile.cpp. References KConfigBase::deleteEntry(), KABC::StdAddressBook::fileName(), KConfigBase::writeEntry(), and KConfigBase::writePathEntry(). |
|
Tries to open the file and checks for the proper format. This method should be called before load(). Definition at line 146 of file resourcefile.cpp. References KABC::FormatPlugin::checkFormat(). |
|
Closes the file again.
Definition at line 173 of file resourcefile.cpp. |
|
Requests a save ticket, that is used by save().
Definition at line 115 of file resourcefile.cpp. References endl(), KABC::Lock::error(), kdDebug(), and KABC::Lock::lock(). |
|
Loads all addressees from file to the address book. Returns true if all addressees could be loaded otherwise false. Definition at line 177 of file resourcefile.cpp. References endl(), kdDebug(), and KABC::FormatPlugin::loadAll(). |
|
Saves all addresses from address book to file. Returns true if all addressees could be saved otherwise false.
Definition at line 217 of file resourcefile.cpp. References KSaveFile::backupFile(), KSaveFile::close(), endl(), KSaveFile::file(), kdDebug(), KABC::FormatPlugin::saveAll(), and KSaveFile::status(). |
|
Set name of file to be used for saving.
Definition at line 267 of file resourcefile.cpp. |
|
Return name of file used for loading and saving the address book.
Definition at line 279 of file resourcefile.cpp. Referenced by ResourceFile(). |
|
Sets a new format by name.
Definition at line 284 of file resourcefile.cpp. References KABC::FormatFactory::format(), and KABC::FormatFactory::self(). |
|
Returns the format name.
Definition at line 293 of file resourcefile.cpp. |
|
Remove a addressee from its source. This method is mainly called by KABC::AddressBook. Definition at line 313 of file resourcefile.cpp. References locateLocal(), and KABC::Addressee::uid(). |
The documentation for this class was generated from the following files: