equal
deleted
inserted
replaced
55 TInt status = iStatus.Int(); |
55 TInt status = iStatus.Int(); |
56 |
56 |
57 switch( status ) |
57 switch( status ) |
58 { |
58 { |
59 case KErrNone: |
59 case KErrNone: |
60 iFileServerSession.Volume( volumeInfo, iDrive ); |
60 { |
|
61 const TInt error = iFileServerSession.Volume( volumeInfo, iDrive ); |
|
62 if( error != KErrNone ) |
|
63 { |
|
64 StartNotifier(); |
|
65 break; |
|
66 } |
61 |
67 |
62 // Check if free space is less than threshold level |
68 // Check if free space is less than threshold level |
63 if( volumeInfo.iFree < iThreshold ) |
69 if( volumeInfo.iFree < iThreshold ) |
64 { |
70 { |
65 iObserver.HandleDiskSpaceNotificationL( MMdSDiskSpaceNotifierObserver::ELess ); |
71 iObserver.HandleDiskSpaceNotificationL( MMdSDiskSpaceNotifierObserver::ELess ); |
76 iObserver.HandleDiskSpaceNotificationL( MMdSDiskSpaceNotifierObserver::EMore ); |
82 iObserver.HandleDiskSpaceNotificationL( MMdSDiskSpaceNotifierObserver::EMore ); |
77 iDiskFull = EFalse; |
83 iDiskFull = EFalse; |
78 } |
84 } |
79 StartNotifier(); |
85 StartNotifier(); |
80 break; |
86 break; |
|
87 } |
81 |
88 |
82 case KErrArgument: |
89 case KErrArgument: |
83 User::Leave( status ); |
90 User::Leave( status ); |
84 break; |
91 break; |
85 default: |
92 default: |
87 } |
94 } |
88 } |
95 } |
89 else if ( iState == CMdSDiskSpaceNotifierAO::EIterate ) |
96 else if ( iState == CMdSDiskSpaceNotifierAO::EIterate ) |
90 { |
97 { |
91 const TInt KMaxIterations = 10; |
98 const TInt KMaxIterations = 10; |
92 |
99 TInt error = iFileServerSession.Volume( volumeInfo, iDrive ); |
93 iFileServerSession.Volume( volumeInfo, iDrive ); |
100 if( error != KErrNone ) |
|
101 { |
|
102 iState = ENormal; |
|
103 iIterationCount = 0; |
|
104 StartNotifier(); |
|
105 return; |
|
106 } |
|
107 |
94 if ( volumeInfo.iFree < iThreshold ) |
108 if ( volumeInfo.iFree < iThreshold ) |
95 { |
109 { |
96 iObserver.HandleDiskSpaceNotificationL( MMdSDiskSpaceNotifierObserver::ELess ); |
110 iObserver.HandleDiskSpaceNotificationL( MMdSDiskSpaceNotifierObserver::ELess ); |
97 ++iIterationCount; |
111 ++iIterationCount; |
98 if ( iIterationCount < KMaxIterations ) |
112 if ( iIterationCount < KMaxIterations ) |
102 User::RequestComplete( status, KErrNone ); |
116 User::RequestComplete( status, KErrNone ); |
103 return; |
117 return; |
104 } |
118 } |
105 else |
119 else |
106 { |
120 { |
107 iFileServerSession.Volume( volumeInfo, iDrive ); |
121 error = iFileServerSession.Volume( volumeInfo, iDrive ); |
|
122 if( error != KErrNone ) |
|
123 { |
|
124 iState = ENormal; |
|
125 iIterationCount = 0; |
|
126 StartNotifier(); |
|
127 return; |
|
128 } |
108 if ( volumeInfo.iFree >= iThreshold ) |
129 if ( volumeInfo.iFree >= iThreshold ) |
109 { |
130 { |
110 iDiskFull = EFalse; |
131 iDiskFull = EFalse; |
111 } |
132 } |
112 } |
133 } |
153 TInt KMessageSlotCount = 2; // slots for NotifyDiskSpace and NotifyDiskSpaceCancel |
174 TInt KMessageSlotCount = 2; // slots for NotifyDiskSpace and NotifyDiskSpaceCancel |
154 |
175 |
155 User::LeaveIfError( iFileServerSession.Connect( KMessageSlotCount ) ); |
176 User::LeaveIfError( iFileServerSession.Connect( KMessageSlotCount ) ); |
156 |
177 |
157 TVolumeInfo volumeInfo; |
178 TVolumeInfo volumeInfo; |
158 iFileServerSession.Volume( volumeInfo, iDrive ); |
179 const TInt error = iFileServerSession.Volume( volumeInfo, iDrive ); |
159 if ( volumeInfo.iFree < iThreshold ) |
180 if ( (error != KErrNone) || volumeInfo.iFree < iThreshold ) |
160 { |
181 { |
161 iDiskFull = ETrue; |
182 iDiskFull = ETrue; |
162 } |
183 } |
163 |
184 |
164 StartNotifier(); |
185 StartNotifier(); |