akabeihook_p.h 1.09 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
   This file is part of the Chakra project

   Copyright (C) 2011 Lukas Appelhans <boom1992@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.
*/

#ifndef AKABEI_AKABEIHOOK_P_H
#define AKABEI_AKABEIHOOK_P_H

15
#include <akabeihook.h>
16

17
#include <QTemporaryFile>
18
#include <QReadWriteLock>
19 20 21 22 23

namespace Akabei {

class HookPrivate {
    public:
Lukas Appelhans's avatar
Lukas Appelhans committed
24
        HookPrivate(const QString &n, const QString &c, QList<Akabei::Package*> pkgs)
25 26
            : name(n)
            , content(c)
Lukas Appelhans's avatar
Lukas Appelhans committed
27
            , packages(pkgs)
28
            , file(nullptr)
29
            , mutex(new QReadWriteLock())
30 31
        {}

32 33 34 35 36 37
        ~HookPrivate() {
            delete file;
            delete mutex;
        }
        
    private:
38 39
        QString name;
        QString content;
Lukas Appelhans's avatar
Lukas Appelhans committed
40
        QList<Akabei::Package*> packages;
41

42
        QTemporaryFile * file;
43 44 45 46

        QReadWriteLock *mutex;
        
        friend class Hook;
47 48 49 50 51
};

}

#endif