summaryrefslogtreecommitdiffstats
path: root/akregator/src/articleinterceptor.cpp
blob: c184713ad0b37a99f40bd7264a7fd4a68bde8b5f (plain)
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
#include "article.h"
#include "articleinterceptor.h"

#include <qvaluelist.h>
#include <kstaticdeleter.h>

namespace Akregator
{

class ArticleInterceptorManager::ArticleInterceptorManagerPrivate 
{
    public:
        QValueList<ArticleInterceptor*> interceptors;
};


ArticleInterceptorManager* ArticleInterceptorManager::m_self = 0;
KStaticDeleter<ArticleInterceptorManager> interceptormanagersd;

ArticleInterceptorManager* ArticleInterceptorManager::self()
{
    if (!m_self)
        interceptormanagersd.setObject(m_self, new ArticleInterceptorManager);
    return m_self;
}

ArticleInterceptorManager::~ArticleInterceptorManager() 
{
    delete d; 
    d = 0;
}

ArticleInterceptorManager::ArticleInterceptorManager() : d(new ArticleInterceptorManagerPrivate)
{}

void ArticleInterceptorManager::addInterceptor(ArticleInterceptor* interceptor)
{
    d->interceptors.append(interceptor);
}

void ArticleInterceptorManager::removeInterceptor(ArticleInterceptor* interceptor)
{
    d->interceptors.remove(interceptor);
}

QValueList<ArticleInterceptor*> ArticleInterceptorManager::interceptors() const
{
    return d->interceptors;
}

}