1 | /* |
2 | Copyright (c) 2009 Constantin Berzan <exit3219@gmail.com> |
3 | |
4 | This library is free software; you can redistribute it and/or modify it |
5 | under the terms of the GNU Library General Public License as published by |
6 | the Free Software Foundation; either version 2 of the License, or (at your |
7 | option) any later version. |
8 | |
9 | This library is distributed in the hope that it will be useful, but WITHOUT |
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public |
12 | License for more details. |
13 | |
14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to the |
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
17 | 02110-1301, USA. |
18 | */ |
19 | |
20 | #include "dispatchmodeattribute.h" |
21 | #include "errorattribute.h" |
22 | #include "sentactionattribute.h" |
23 | #include "sentbehaviourattribute.h" |
24 | #include "transportattribute.h" |
25 | |
26 | #include <akonadi/attributefactory.h> |
27 | |
28 | #ifndef KDELIBS_STATIC_LIBS |
29 | namespace { |
30 | |
31 | // Anonymous namespace; function is invisible outside this file. |
32 | bool dummy() |
33 | { |
34 | using namespace Akonadi; |
35 | using namespace MailTransport; |
36 | AttributeFactory::registerAttribute<DispatchModeAttribute>(); |
37 | AttributeFactory::registerAttribute<ErrorAttribute>(); |
38 | AttributeFactory::registerAttribute<SentActionAttribute>(); |
39 | AttributeFactory::registerAttribute<SentBehaviourAttribute>(); |
40 | AttributeFactory::registerAttribute<TransportAttribute>(); |
41 | return true; |
42 | } |
43 | |
44 | // Called when this library is loaded. |
45 | const bool registered = dummy(); |
46 | |
47 | } // namespace |
48 | |
49 | #else |
50 | |
51 | extern bool ___MailTransport____INIT() |
52 | { |
53 | using namespace Akonadi; |
54 | using namespace MailTransport; |
55 | AttributeFactory::registerAttribute<DispatchModeAttribute>(); |
56 | AttributeFactory::registerAttribute<ErrorAttribute>(); |
57 | AttributeFactory::registerAttribute<SentActionAttribute>(); |
58 | AttributeFactory::registerAttribute<SentBehaviourAttribute>(); |
59 | AttributeFactory::registerAttribute<TransportAttribute>(); |
60 | return true; |
61 | } |
62 | |
63 | #endif |
64 | |