kabc
KABC::Lock Class Reference
#include <lock.h>
Inheritance diagram for KABC::Lock:

Detailed Description
This class provides locking functionality for a file, directory or an arbitrary string-represented resource.Definition at line 34 of file lock.h.
Signals | |
void | locked () |
void | unlocked () |
Public Member Functions | |
virtual QString | error () const |
virtual bool | lock () |
Lock (const QString &identifier) | |
QString | lockFileName () const |
virtual bool | unlock () |
~Lock () | |
Static Public Member Functions | |
static QString | locksDir () |
static bool | readLockFile (const QString &filename, int &pid, QString &app) |
static bool | writeLockFile (const QString &filename) |
Constructor & Destructor Documentation
Lock::Lock | ( | const QString & | identifier | ) |
Lock::~Lock | ( | ) |
Member Function Documentation
QString Lock::error | ( | ) | const [virtual] |
bool Lock::lock | ( | ) | [virtual] |
void KABC::Lock::locked | ( | ) | [signal] |
Emitted after the lock has been locked.
QString Lock::lockFileName | ( | ) | const |
Returns the path of the lock file.
The file will be located in the directory returned by locksDir() and have the file extension .lock
QString Lock::locksDir | ( | ) | [static] |
bool Lock::readLockFile | ( | const QString & | filename, | |
int & | pid, | |||
QString & | app | |||
) | [static] |
Reads the process ID and the application name from a lock file.
- Parameters:
-
filename The lock file to read from. Full path or relative to current working directory pid The variable the process ID will be read into app The variable the application name will be read into
- Returns:
false
iffilename
could not be read, otherwisetrue
, even when reading the values fails
bool Lock::unlock | ( | ) | [virtual] |
void KABC::Lock::unlocked | ( | ) | [signal] |
Emitted after the lock has been unlocked.
bool Lock::writeLockFile | ( | const QString & | filename | ) | [static] |
The documentation for this class was generated from the following files: