akabeierror.cpp 1.24 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
/* This file is part of the Chakra project

   Copyright (C) 2010 Dario Freddi <drf@chakra-project.org>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
*/

#include "akabeierror.h"

namespace Akabei
{

class Error::Private
{
    public:
        Private() {}
        virtual ~Private() {}

        Type type;
        QString desc;
        Operation *op;
        QList<Package*> packages;
};

Error::Error(Error::Type type, const QString& description, Operation* op)
    : d(new Private)
{
    d->type = type;
    d->desc = description;
    d->op = op;
}

Error::~Error()
{
    delete d;
}

QString Error::description() const
{
    return d->desc;
}

Operation* Error::operation()
{
    return d->op;
}

void Error::setDescription(const QString& description)
{
    d->desc = description;
}

void Error::setOperation(Operation* op)
{
    d->op = op;
}

void Error::setTargets(const QList< Package* >& targets)
{
    d->packages = targets;
}

QList< Package* > Error::targets() const
{
    return d->packages;
}

Error::Type Error::type() const
{
    return d->type;
}

}