akregator/src

articleinterceptor.cpp
1 #include "article.h"
2 #include "articleinterceptor.h"
3 
4 #include <tqvaluelist.h>
5 #include <kstaticdeleter.h>
6 
7 namespace Akregator
8 {
9 
10 class ArticleInterceptorManager::ArticleInterceptorManagerPrivate
11 {
12  public:
13  TQValueList<ArticleInterceptor*> interceptors;
14 };
15 
16 
17 ArticleInterceptorManager* ArticleInterceptorManager::m_self = 0;
18 KStaticDeleter<ArticleInterceptorManager> interceptormanagersd;
19 
20 ArticleInterceptorManager* ArticleInterceptorManager::self()
21 {
22  if (!m_self)
23  interceptormanagersd.setObject(m_self, new ArticleInterceptorManager);
24  return m_self;
25 }
26 
27 ArticleInterceptorManager::~ArticleInterceptorManager()
28 {
29  delete d;
30  d = 0;
31 }
32 
33 ArticleInterceptorManager::ArticleInterceptorManager() : d(new ArticleInterceptorManagerPrivate)
34 {}
35 
36 void ArticleInterceptorManager::addInterceptor(ArticleInterceptor* interceptor)
37 {
38  d->interceptors.append(interceptor);
39 }
40 
41 void ArticleInterceptorManager::removeInterceptor(ArticleInterceptor* interceptor)
42 {
43  d->interceptors.remove(interceptor);
44 }
45 
46 TQValueList<ArticleInterceptor*> ArticleInterceptorManager::interceptors() const
47 {
48  return d->interceptors;
49 }
50 
51 }
52