Commit 14abc03e authored by Lukas Appelhans's avatar Lukas Appelhans
Browse files

Docs

parent 281c96ff
......@@ -14,14 +14,24 @@
#include <QtCore/QObject>
namespace Akabei {
class HookPrivate;
class Database;
class Package;
/**
* \class Hook akabeihook.h "akabeihook.h"
*
* \brief This class describes a script which possibly gets executed once in a transaction.
*
* A Hook is basically a scriplet, but on a global scale.
* Even though multiple packages can request a hook to be executed,
* it will only be done once at the end of the transaction.
*
* For example, we have a bunch of packages wanting to run kbuildsycoca4 to update kde's plugin cache.
* Since this command is quite expensive it took a lot of time in pacman days to install multiple of
* those packages as every package was executing the command on itself.
* Now we just have a hook running kbuildsycoca4 inside the database and all those packages use it. It
* then gets executed only once at the end of the transaction.
*/
class HookPrivate;
class Database;
class Package;
class Hook
{
Q_DISABLE_COPY(Hook)
......@@ -29,14 +39,24 @@ class Hook
public:
virtual ~Hook();
/**
* @returns the name of the hook
*/
QString name() const;
/**
* @returns the script which gets executed when running the hook
*/
QString content() const;
/**
* @returns a list of packages which request this hook on transaction
*/
QList<Akabei::Package*> packages() const;
/**
* A temporary script file gets created.
* @returns a path to a file containing the content()
* A developer can now easily run the script with a \c QProcess object
*/
QString path();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment