Commit 57b1142f authored by Lukas Appelhans's avatar Lukas Appelhans

Rename and install

parent 0ee6ebc2
......@@ -52,6 +52,7 @@ operations/akabeiplaininstalloperation.h
operations/akabeiplainremoveoperation.h
operations/akabeiplainscriptletoperation.h
operations/akabeiplainupgradeoperation.h
operations/akabeiplainhookoperation.h
)
qt4_automoc(${AKABEI_CORE_SRCS})
......
......@@ -19,10 +19,10 @@
#include <QDebug>
namespace Akabei {
class AkabeiPlainHookOperation::Private
class PlainHookOperation::Private
{
public:
Private(AkabeiPlainHookOperation * op) : q(op) {}
Private(PlainHookOperation * op) : q(op) {}
~Private() {}
void process();
......@@ -30,7 +30,7 @@ public:
void slotFinished(bool fin);
void slotMessage(const QString &mes);
AkabeiPlainHookOperation *q;
PlainHookOperation *q;
QSet<Hook*> hooks;
QSet<Hook*>::iterator it;
};
......@@ -40,23 +40,23 @@ class HookOpHelper
public:
HookOpHelper() : q(0) {}
~HookOpHelper() {
delete q;
//delete q;//Operations get automagically deleted
}
AkabeiPlainHookOperation *q;
PlainHookOperation *q;
};
Q_GLOBAL_STATIC(HookOpHelper, s_globalHookOp)
AkabeiPlainHookOperation *AkabeiPlainHookOperation::instance()
PlainHookOperation *PlainHookOperation::instance()
{
if (!s_globalHookOp()->q) {
new AkabeiPlainHookOperation;
new PlainHookOperation;
}
return s_globalHookOp()->q;
}
AkabeiPlainHookOperation::AkabeiPlainHookOperation()
PlainHookOperation::PlainHookOperation()
: QObject(0),
Operation("Hooks"),
d(new Private(this))
......@@ -69,24 +69,24 @@ AkabeiPlainHookOperation::AkabeiPlainHookOperation()
setDescription(tr("Running hooks..."));
}
AkabeiPlainHookOperation::~AkabeiPlainHookOperation()
PlainHookOperation::~PlainHookOperation()
{
delete d;
}
void AkabeiPlainHookOperation::add(Hook* hook)
void PlainHookOperation::add(Hook* hook)
{
qDebug() << "Add hook" << hook->name();
d->hooks.insert(hook);
}
void AkabeiPlainHookOperation::add(const QList<Hook*> &hooks)
void PlainHookOperation::add(const QList<Hook*> &hooks)
{
foreach (Hook* hook, hooks)
add(hook);
}
void AkabeiPlainHookOperation::run()
void PlainHookOperation::run()
{
qDebug() << "Run hookoperation";
d->it = d->hooks.begin();
......@@ -94,7 +94,7 @@ void AkabeiPlainHookOperation::run()
setFinished(true);
}
void AkabeiPlainHookOperation::Private::process()
void PlainHookOperation::Private::process()
{
if (it == hooks.end()) {
q->setFinished(true);
......@@ -109,12 +109,12 @@ void AkabeiPlainHookOperation::Private::process()
process->run(QString("sh %1").arg((*it)->path()));
}
void AkabeiPlainHookOperation::Private::slotErrors(QList< Error* > errors)
void PlainHookOperation::Private::slotErrors(QList< Error* > errors)
{
q->setErrors(errors);
}
void AkabeiPlainHookOperation::Private::slotFinished(bool fin)
void PlainHookOperation::Private::slotFinished(bool fin)
{
if (fin) {
it++;
......@@ -122,12 +122,12 @@ void AkabeiPlainHookOperation::Private::slotFinished(bool fin)
}
}
void AkabeiPlainHookOperation::Private::slotMessage(const QString& mes)
void PlainHookOperation::Private::slotMessage(const QString& mes)
{
q->addMessage(mes);
}
void AkabeiPlainHookOperation::validate()
void PlainHookOperation::validate()
{
setValidationFinished(true);
}
......
......@@ -16,13 +16,13 @@
namespace Akabei {
class Database;
class AKABEICORESHARED_EXPORT AkabeiPlainHookOperation : public QObject, public Operation
class AKABEICORESHARED_EXPORT PlainHookOperation : public QObject, public Operation
{
Q_OBJECT
public:
virtual ~AkabeiPlainHookOperation();
virtual ~PlainHookOperation();
static AkabeiPlainHookOperation * instance();
static PlainHookOperation * instance();
void add(Hook* hook);
void add(const QList<Hook*> &hooks);
......@@ -32,7 +32,7 @@ class AKABEICORESHARED_EXPORT AkabeiPlainHookOperation : public QObject, public
virtual void validate();
private:
AkabeiPlainHookOperation();
PlainHookOperation();
class Private;
Private * const d;
......
......@@ -261,7 +261,7 @@ void PlainInstallOperation::validate()
// Same for hooks
if (d->package->hasHooks()) {
qDebug() << "We have hooks" << d->package->hooks();
AkabeiPlainHookOperation::instance()->add(d->package->retrieveHooks());
PlainHookOperation::instance()->add(d->package->retrieveHooks());
}
}
......
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