23 #define RD_CALENDAR_PREVIEW |
23 #define RD_CALENDAR_PREVIEW |
24 |
24 |
25 #ifndef PIM_TRACE_H |
25 #ifndef PIM_TRACE_H |
26 #define PIM_TRACE_H |
26 #define PIM_TRACE_H |
27 |
27 |
28 #if defined (_DEBUG) || defined (_PIM_FILE_LOG) || defined (_DISPLAY_WARNINGS) |
28 #if defined (_DEBUG) || defined (_PIM_FILE_LOG) |
29 //Includes |
29 //Includes |
30 #include <e32base.h> |
30 #include <e32base.h> |
31 #include <e32std.h> |
31 #include <e32std.h> |
32 #include <flogger.h> |
32 #include <flogger.h> |
33 #include <e32svr.h> |
33 #include <e32svr.h> |
34 #include <f32file.h> |
34 #include <f32file.h> |
35 //#include <AknGlobalConfirmationQuery.h> |
35 |
36 const TInt KMaxLogLineLength = 512; |
36 const TInt KMaxLogLineLength = 512; |
37 #endif |
37 #endif |
38 |
38 #if defined( _DEBUG ) |
39 /** |
|
40 * Define our own trap and assert macros to prevent compiler warnings. |
|
41 */ |
|
42 #if defined (_DISPLAY_WARNINGS) |
|
43 _LIT( KWarningFormat, " error %d trapped %S line %d"); |
|
44 inline void DisplayWarningNote( TInt aError, const TDesC8& aFile, TInt aWarningNote ) |
|
45 { |
|
46 /*if ( aError ) |
|
47 { |
|
48 TRAP_IGNORE( |
|
49 CAknGlobalConfirmationQuery* cq = CAknGlobalConfirmationQuery::NewL(); |
|
50 CleanupStack::PushL( cq ); |
|
51 |
|
52 TBuf<KMaxLogLineLength> text; |
|
53 TBuf<128> fileName; |
|
54 fileName.Copy( aFile ); |
|
55 text.Format( KWarningFormat, aError, &fileName, aWarningNote ); |
|
56 |
|
57 TRequestStatus stat = KRequestPending; |
|
58 cq->ShowConfirmationQueryL( stat, text, R_AVKON_SOFTKEYS_YES_NO ); |
|
59 User::WaitForRequest( stat ); |
|
60 |
|
61 CleanupStack::PopAndDestroy( cq ); |
|
62 ); |
|
63 } */ |
|
64 } |
|
65 |
|
66 inline void DisplayWarningNote( const TDesC& aNote ) |
|
67 { |
|
68 /*TRAP_IGNORE( |
|
69 CAknGlobalConfirmationQuery* cq = CAknGlobalConfirmationQuery::NewL(); |
|
70 CleanupStack::PushL( cq ); |
|
71 |
|
72 |
|
73 TRequestStatus stat = KRequestPending; |
|
74 cq->ShowConfirmationQueryL( stat, aNote, R_AVKON_SOFTKEYS_YES_NO ); |
|
75 User::WaitForRequest( stat ); |
|
76 |
|
77 CleanupStack::PopAndDestroy( cq ); |
|
78 );*/ |
|
79 } |
|
80 |
|
81 #undef TRAP_INSTRUMENTATION_LEAVE |
|
82 #define TRAP_INSTRUMENTATION_LEAVE(aResult) DisplayWarningNote( aResult,TPtrC8( ( TText8* )__FILE__), __LINE__); |
|
83 |
|
84 #define PIM_TRAP_HANDLE( _err, _s ) \ |
|
85 { \ |
|
86 TRAP( _err, _s; ); \ |
|
87 DisplayWarningNote( _err,TPtrC8( ( TText8* )__FILE__),__LINE__ ); \ |
|
88 } |
|
89 #define PIM_TRAPD_HANDLE( _s ) \ |
|
90 { \ |
|
91 TRAPD( _err, _s; ); \ |
|
92 DisplayWarningNote( _err, TPtrC8( ( TText8* )__FILE__), __LINE__ ); \ |
|
93 } |
|
94 #define WARNING_NOTE( _s ) DisplayWarningNote( _s ); |
|
95 |
|
96 #elif defined( _DEBUG ) |
|
97 #define PIM_TRAP_HANDLE( _err, _s ) \ |
39 #define PIM_TRAP_HANDLE( _err, _s ) \ |
98 { \ |
40 { \ |
99 TRAP( _err, _s; ); \ |
41 TRAP( _err, _s; ); \ |
100 ASSERT( !_err ); \ |
42 ASSERT( !_err ); \ |
101 } |
43 } |