|
1 #include <emailmru.h> |
|
2 |
|
3 extern bool constructorCalled; |
|
4 extern bool destructorCalled; |
|
5 extern bool entryCountCalled; |
|
6 extern bool getEntryCalled; |
|
7 extern bool nameOrderCalled; |
|
8 extern bool fillMruWithFalseValues; |
|
9 |
|
10 EmailMRU::EmailMRU() |
|
11 { |
|
12 constructorCalled = true; |
|
13 } |
|
14 |
|
15 EmailMRU::~EmailMRU() |
|
16 { |
|
17 destructorCalled = true; |
|
18 } |
|
19 |
|
20 quint32 EmailMRU::entryCount() const |
|
21 { |
|
22 entryCountCalled = true; |
|
23 |
|
24 if (!fillMruWithFalseValues) |
|
25 { |
|
26 return 2; |
|
27 } |
|
28 else |
|
29 { |
|
30 return 3; |
|
31 } |
|
32 } |
|
33 |
|
34 bool EmailMRU::getEntry(qint32 entryIndex, QString &displayName, QString &address) |
|
35 { |
|
36 getEntryCalled = true; |
|
37 bool success = false; |
|
38 |
|
39 if (!fillMruWithFalseValues) |
|
40 { |
|
41 switch (entryIndex) |
|
42 { |
|
43 case 1: |
|
44 displayName = "Camel Case"; |
|
45 address = "camel.case@plusplus.com"; |
|
46 success = true; |
|
47 break; |
|
48 case 2: |
|
49 displayName = "Agent Reference"; |
|
50 address = "byvalue@plusplus.com"; |
|
51 success = true; |
|
52 break; |
|
53 default: |
|
54 displayName = "Default Name"; |
|
55 address = "default@default.com"; |
|
56 success = false; |
|
57 break; |
|
58 } |
|
59 } |
|
60 else |
|
61 { |
|
62 switch (entryIndex) |
|
63 { |
|
64 case 1: |
|
65 // Without display name |
|
66 displayName = ""; |
|
67 address = "camel.case@plusplus.com"; |
|
68 success = true; |
|
69 break; |
|
70 case 2: |
|
71 // Email Matching purpose |
|
72 displayName = "Agent Plus"; |
|
73 address = "plus@plusplus.com"; |
|
74 success = true; |
|
75 break; |
|
76 case 3: |
|
77 // Match in other |
|
78 displayName = "Agent Smith"; |
|
79 address = "noreply@mib.com"; |
|
80 success = true; |
|
81 break; |
|
82 default: |
|
83 displayName = "Default Name"; |
|
84 address = "default@default.com"; |
|
85 success = false; |
|
86 break; |
|
87 } |
|
88 } |
|
89 |
|
90 return success; |
|
91 } |
|
92 |
|
93 int EmailMRU::nameOrder() |
|
94 { |
|
95 nameOrderCalled = true; |
|
96 return 2; |
|
97 } |