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