24 // CTsFsWidgetList::NewL |
24 // CTsFsWidgetList::NewL |
25 // -------------------------------------------------------------------------- |
25 // -------------------------------------------------------------------------- |
26 // |
26 // |
27 CTsFsWidgetList* CTsFsWidgetList::NewL() |
27 CTsFsWidgetList* CTsFsWidgetList::NewL() |
28 { |
28 { |
29 return new (ELeave) CTsFsWidgetList; |
29 CTsFsWidgetList* self = new (ELeave) CTsFsWidgetList(); |
|
30 CleanupStack::PushL (self ); |
|
31 self->ConstructL ( ); |
|
32 CleanupStack::Pop ( self ); |
|
33 return self; |
|
34 } |
|
35 |
|
36 // -------------------------------------------------------------------------- |
|
37 // CTsFsWidgetList::CTsFsWidgetList |
|
38 // -------------------------------------------------------------------------- |
|
39 // |
|
40 void CTsFsWidgetList::ConstructL() |
|
41 { |
|
42 User::LeaveIfError( iWidgetRegistryClientSession.Connect() ); |
30 } |
43 } |
31 |
44 |
32 // -------------------------------------------------------------------------- |
45 // -------------------------------------------------------------------------- |
33 // CTsFsWidgetList::CTsFsWidgetList |
46 // CTsFsWidgetList::CTsFsWidgetList |
34 // -------------------------------------------------------------------------- |
47 // -------------------------------------------------------------------------- |
35 // |
48 // |
36 CTsFsWidgetList::CTsFsWidgetList() |
49 CTsFsWidgetList::CTsFsWidgetList() |
37 { |
50 { |
38 } |
51 } |
39 |
52 |
40 // -------------------------------------------------------------------------- |
53 // -------------------------------------------------------------------------- |
41 // CTsFsWidgetList::~CTsFsWidgetList |
54 // CTsFsWidgetList::~CTsFsWidgetList |
42 // -------------------------------------------------------------------------- |
55 // -------------------------------------------------------------------------- |
43 // |
56 // |
44 CTsFsWidgetList::~CTsFsWidgetList() |
57 CTsFsWidgetList::~CTsFsWidgetList() |
45 { |
58 { |
46 ResetArrayOfWidgetInfo( iRunningWidgets ); |
59 ResetArrayOfWidgetInfo( iRunningWidgets ); |
47 iRunningWidgets.Reset(); |
60 iRunningWidgets.Reset(); |
48 } |
61 iWidgetRegistryClientSession.Disconnect(); |
49 |
|
50 // -------------------------------------------------------------------------- |
|
51 // CTsFsWidgetList::CleanupConnect |
|
52 // -------------------------------------------------------------------------- |
|
53 // |
|
54 void CTsFsWidgetList::CleanupConnect( TAny* aThis ) |
|
55 { |
|
56 CTsFsWidgetList* self = static_cast<CTsFsWidgetList*>( aThis ); |
|
57 self->iWidgetRegistryClientSession.Disconnect(); |
|
58 } |
62 } |
59 |
63 |
60 // -------------------------------------------------------------------------- |
64 // -------------------------------------------------------------------------- |
61 // CTsFsWidgetList::InitializeWidgetListL |
65 // CTsFsWidgetList::InitializeWidgetListL |
62 // -------------------------------------------------------------------------- |
66 // -------------------------------------------------------------------------- |
63 // |
67 // |
64 void CTsFsWidgetList::InitializeWidgetListL() |
68 void CTsFsWidgetList::InitializeWidgetListL() |
65 { |
69 { |
66 ResetArrayOfWidgetInfo( iRunningWidgets ); |
70 ResetArrayOfWidgetInfo( iRunningWidgets ); |
67 iRunningWidgets.Reset(); |
71 iRunningWidgets.Reset(); |
68 User::LeaveIfError( iWidgetRegistryClientSession.Connect() ); |
72 iWidgetRegistryClientSession.RunningWidgetsL(iRunningWidgets); |
69 CleanupStack::PushL( TCleanupItem( CleanupConnect, this) ); |
|
70 iWidgetRegistryClientSession.RunningWidgetsL(iRunningWidgets); |
|
71 //modify useless file size information with mode flag |
73 //modify useless file size information with mode flag |
72 for ( TInt i(iRunningWidgets.Count() - 1); 0 <= i; --i ) |
74 for ( TInt i(iRunningWidgets.Count() - 1); 0 <= i; --i ) |
73 { |
75 { |
74 iRunningWidgets[i]->iFileSize = |
76 iRunningWidgets[i]->iFileSize = |
75 iWidgetRegistryClientSession.IsWidgetInFullView(iRunningWidgets[i]->iUid); |
77 iWidgetRegistryClientSession.IsWidgetInFullView(iRunningWidgets[i]->iUid); |
76 } |
78 } |
77 CleanupStack::Pop(); // clean WidgetRegistryClientSession item |
|
78 iWidgetRegistryClientSession.Disconnect(); |
|
79 } |
79 } |
80 |
80 |
81 // -------------------------------------------------------------------------- |
81 // -------------------------------------------------------------------------- |
82 // CTsFsWidgetList::ResetArrayOfWidgetInfo |
82 // CTsFsWidgetList::ResetArrayOfWidgetInfo |
83 // -------------------------------------------------------------------------- |
83 // -------------------------------------------------------------------------- |