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 | |
Lock (const QString &identifier) | |
~Lock () | |
virtual bool | lock () |
virtual bool | unlock () |
virtual QString | error () const |
QString | lockFileName () const |
Static Public Member Functions | |
static bool | readLockFile (const QString &filename, int &pid, QString &app) |
static bool | writeLockFile (const QString &filename) |
static QString | locksDir () |
Constructor & Destructor Documentation
Lock::Lock | ( | const QString & | identifier | ) |
Lock::~Lock | ( | ) |
Member Function Documentation
bool Lock::lock | ( | ) | [virtual] |
bool Lock::unlock | ( | ) | [virtual] |
QString Lock::error | ( | ) | const [virtual] |
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
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::writeLockFile | ( | const QString & | filename | ) | [static] |
QString Lock::locksDir | ( | ) | [static] |
void KABC::Lock::locked | ( | ) | [signal] |
Emitted after the lock has been locked.
void KABC::Lock::unlocked | ( | ) | [signal] |
Emitted after the lock has been unlocked.
The documentation for this class was generated from the following files: