equal
deleted
inserted
replaced
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 #include "nmapiengine.h" |
|
18 #include "nmapimailboxlisting_p.h" |
|
19 |
17 |
20 #include <nmapimailbox.h> |
18 #include "nmapiheaders.h" |
|
19 |
21 |
20 |
22 namespace EmailClientApi |
21 namespace EmailClientApi |
23 { |
22 { |
24 NmApiMailboxListingPrivate::NmApiMailboxListingPrivate(QObject *parent) : |
23 NmApiMailboxListingPrivate::NmApiMailboxListingPrivate(QObject *parent) : |
25 QObject(parent), mNmApiEngine(NULL) |
24 QObject(parent), mNmApiEngine(NULL) |
26 { |
25 { |
27 |
26 NM_FUNCTION; |
28 } |
27 } |
29 |
28 |
30 NmApiMailboxListingPrivate::~NmApiMailboxListingPrivate() |
29 NmApiMailboxListingPrivate::~NmApiMailboxListingPrivate() |
31 { |
30 { |
32 |
31 NM_FUNCTION; |
33 } |
32 } |
34 |
33 |
35 /*! |
34 /*! |
36 \brief It initialize engine for email operations. |
35 \brief It initialize engine for email operations. |
37 |
36 |
40 \sa releaseEngine |
39 \sa releaseEngine |
41 \return Return true if engine is good initilialized. |
40 \return Return true if engine is good initilialized. |
42 */ |
41 */ |
43 bool NmApiMailboxListingPrivate::initializeEngine() |
42 bool NmApiMailboxListingPrivate::initializeEngine() |
44 { |
43 { |
|
44 NM_FUNCTION; |
|
45 |
45 if (!mNmApiEngine) { |
46 if (!mNmApiEngine) { |
46 mNmApiEngine = NmApiEngine::instance(); |
47 mNmApiEngine = NmApiEngine::instance(); |
47 } |
48 } |
48 |
49 |
49 return mNmApiEngine ? true : false; |
50 return mNmApiEngine ? true : false; |
54 |
55 |
55 \sa initializeEngine |
56 \sa initializeEngine |
56 */ |
57 */ |
57 void NmApiMailboxListingPrivate::releaseEngine() |
58 void NmApiMailboxListingPrivate::releaseEngine() |
58 { |
59 { |
|
60 NM_FUNCTION; |
|
61 |
59 NmApiEngine::releaseInstance(mNmApiEngine); |
62 NmApiEngine::releaseInstance(mNmApiEngine); |
60 } |
63 } |
61 |
64 |
62 /*! |
65 /*! |
63 \brief It grab mailboxes from engine. |
66 \brief It grab mailboxes from engine. |
67 |
70 |
68 \return Count of mailboxes or "-1" if there is no engine |
71 \return Count of mailboxes or "-1" if there is no engine |
69 */ |
72 */ |
70 qint32 NmApiMailboxListingPrivate::grabMailboxes() |
73 qint32 NmApiMailboxListingPrivate::grabMailboxes() |
71 { |
74 { |
|
75 NM_FUNCTION; |
|
76 |
72 if (!mNmApiEngine) { |
77 if (!mNmApiEngine) { |
73 return -1; |
78 return -1; |
74 } |
79 } |
75 |
80 |
76 mMailboxes.clear(); |
81 mMailboxes.clear(); |