26 #include <alflogger.h> |
26 #include <alflogger.h> |
27 #include <huiwscanvascommands.h> |
27 #include <huiwscanvascommands.h> |
28 #include "alfcommanddebug.h" |
28 #include "alfcommanddebug.h" |
29 #include <data_caging_path_literals.hrh> |
29 #include <data_caging_path_literals.hrh> |
30 #include <alfcommanddescriptions.rsg> |
30 #include <alfcommanddescriptions.rsg> |
|
31 #include <alfbridgecommands.h> |
31 #include <gdi.h> |
32 #include <gdi.h> |
32 #include <uiacceltk/HuiStatic.h> |
33 #include <uiacceltk/HuiStatic.h> |
33 |
34 |
34 _LIT( KRendererCommandDescriptions,"alfcommanddescriptions.rsc" ); |
35 _LIT( KRendererCommandDescriptions,"alfcommanddescriptions.rsc" ); |
35 |
36 |
43 CleanupStack::PushL(self); |
44 CleanupStack::PushL(self); |
44 self->ConstructL(); |
45 self->ConstructL(); |
45 CleanupStack::Pop(); |
46 CleanupStack::Pop(); |
46 return self; |
47 return self; |
47 } |
48 } |
|
49 |
|
50 // --------------------------------------------------------------------------- |
|
51 // destructor |
|
52 // |
|
53 // Note, you can enable iPrintStatistics at run-time in debugger |
|
54 // --------------------------------------------------------------------------- |
|
55 // |
|
56 EXPORT_C CAlfCommandDebug::~CAlfCommandDebug() |
|
57 { |
|
58 TInt test1 = 0; |
|
59 TInt testCount1 = iCommandDescriptions->Count(); |
|
60 |
|
61 THashMapIter <TUint32,TCommand> ptrHashSetIter(*iCommandDescriptions); |
|
62 for ( ; ; ) |
|
63 { |
|
64 const TCommand* resNext = ptrHashSetIter.NextValue(); |
|
65 if (!resNext) |
|
66 { |
|
67 break; |
|
68 } |
|
69 //RDebug::Print(_L("!!HV: ~CAlfCommandDebug. DELETE: command.iDescription=%S (0x%x)"), |
|
70 // resNext->iDescription, resNext->iDescription); |
|
71 delete resNext->iDescription; |
|
72 test1++; |
|
73 } |
|
74 |
|
75 if (test1 != testCount1) |
|
76 { |
|
77 RDebug::Print(_L("CAlfCommandDebug::~CAlfCommandDebug(). Mismatch in iCommandDescriptions delete: deleted=%d, array count=%d"), test1, testCount1); |
|
78 } |
|
79 |
|
80 TInt test2 = 0; |
|
81 TInt testCount2 = iBridgeCommandDescriptions->Count(); |
|
82 |
|
83 THashMapIter <TUint32,TCommand> ptrHashSetIter2(*iBridgeCommandDescriptions); |
|
84 for ( ; ; ) |
|
85 { |
|
86 const TCommand* resNext = ptrHashSetIter2.NextValue(); |
|
87 if (!resNext) |
|
88 { |
|
89 break; |
|
90 } |
|
91 //RDebug::Print(_L("!!HV: ~CAlfCommandDebug. DELETE2: command.iDescription=%S (0x%x)"), |
|
92 // resNext->iDescription, resNext->iDescription); |
|
93 delete resNext->iDescription; |
|
94 test2++; |
|
95 } |
|
96 |
|
97 if (test2 != testCount2) |
|
98 { |
|
99 RDebug::Print(_L("CAlfCommandDebug::~CAlfCommandDebug(). Mismatch in iBridgeCommandDescriptions delete: deleted=%d, array count=%d"), test2, testCount2); |
|
100 } |
|
101 |
|
102 iCommandDescriptions->Close(); |
|
103 iBridgeCommandDescriptions->Close(); |
|
104 |
|
105 delete iCommandDescriptions; |
|
106 delete iBridgeCommandDescriptions; |
|
107 } |
|
108 |
48 |
109 |
49 // --------------------------------------------------------------------------- |
110 // --------------------------------------------------------------------------- |
50 // ConstructL |
111 // ConstructL |
51 // --------------------------------------------------------------------------- |
112 // --------------------------------------------------------------------------- |
52 // |
113 // |
156 { |
217 { |
157 commandId = reader.ReadInt8(); |
218 commandId = reader.ReadInt8(); |
158 TCommand command; |
219 TCommand command; |
159 command.iDescription = reader.ReadHBufC16L(); |
220 command.iDescription = reader.ReadHBufC16L(); |
160 |
221 |
161 aDescriptionArray->Insert(commandId, command); |
222 TCommand* commandPtr = NULL; |
|
223 commandPtr = aDescriptionArray->Find(commandId); |
|
224 if (commandPtr==NULL) |
|
225 { |
|
226 aDescriptionArray->Insert(commandId, command); |
|
227 //RDebug::Print(_L("!!HV: CAlfCommandDebug::ReadCommandDescriptionsL. INSERT: commandId=%d, command.iDescription=%S (0x%x)"), |
|
228 // commandId, command.iDescription, command.iDescription); |
|
229 } |
|
230 else |
|
231 { |
|
232 RDebug::Print(_L("!!HV: CAlfCommandDebug::ReadCommandDescriptionsL. ERROR. Duplicate command descriptions in the resource file! Skip the latter description. commandId=%d, command.iDescription=%S"), |
|
233 commandId, command.iDescription); |
|
234 delete command.iDescription; |
|
235 } |
162 } |
236 } |
163 CleanupStack::PopAndDestroy(readData); |
237 CleanupStack::PopAndDestroy(readData); |
164 } |
238 } |
165 else |
239 else |
166 { |
240 { |
441 { |
515 { |
442 iPrint = aPrint; |
516 iPrint = aPrint; |
443 } |
517 } |
444 |
518 |
445 // --------------------------------------------------------------------------- |
519 // --------------------------------------------------------------------------- |
446 // destructor |
|
447 // |
|
448 // Note, you can enable iPrintStatistics at run-time in debugger |
|
449 // --------------------------------------------------------------------------- |
|
450 // |
|
451 EXPORT_C CAlfCommandDebug::~CAlfCommandDebug() |
|
452 { |
|
453 delete iCommandDescriptions; |
|
454 } |
|
455 |
|
456 // --------------------------------------------------------------------------- |
|
457 // DebugPrintControlGroupOrder |
520 // DebugPrintControlGroupOrder |
458 // Can be used only from CAlfBridge |
521 // Can be used only from CAlfBridge |
459 // --------------------------------------------------------------------------- |
522 // --------------------------------------------------------------------------- |
460 // |
523 // |
461 EXPORT_C TFileName CAlfCommandDebug::WServClientFileName( TInt aClientWindowGroupId, RWsSession& aSession ) |
524 EXPORT_C TFileName CAlfCommandDebug::WServClientFileName( TInt aClientWindowGroupId, RWsSession& aSession ) |