--- a/webengine/wrtharvester/src/wrtharvesterpsnotifier.cpp Thu Aug 19 10:58:56 2010 +0300
+++ b/webengine/wrtharvester/src/wrtharvesterpsnotifier.cpp Tue Aug 31 16:17:46 2010 +0300
@@ -19,9 +19,7 @@
#include "wrtharvesterpsnotifier.h"
#include "wrtharvester.h"
#include <UikonInternalPSKeys.h>//For MMC Observing
-#include <startupdomainpskeys.h> // For shutdown observer
-#include <UsbWatcherInternalPSKeys.h>// for Mass storage mode observing
-#include <usbpersonalityids.h>
+#include <usbmsshared.h>//For USB monitor
// ============================ MEMBER FUNCTIONS =============================
@@ -73,24 +71,24 @@
{
CActiveScheduler::Add( this );
TInt r(KErrNone);
- if( iKey != EWidgetMassStorageMode )
+ if( iKey != EWidgetMMCAltered )
{
// define property to be integer type
r = RProperty::Define( KPropertyCat, iKey, RProperty::EInt );
}
- if ( r != KErrAlreadyExists && r != KErrNone )
+ if ( r != KErrAlreadyExists || r != KErrNone )
{
User::LeaveIfError( r );
}
// Attach the key
- if( iKey == EWidgetMassStorageMode )
+ if( iKey == EWidgetMMCAltered )
+ {
+ User::LeaveIfError( iProperty.Attach( KPSUidUikon,KUikMMCInserted ));
+ }
+ else if( iKey == EWidgetMassStorageMode )
{
- User::LeaveIfError( iProperty.Attach( KPSUidUsbWatcher,KUsbWatcherSelectedPersonality));
- }
- else if( iKey == EWidgetSystemShutdown )
- {
- User::LeaveIfError( iProperty.Attach( KPSUidStartup,KPSGlobalSystemState ));
+ User::LeaveIfError( iProperty.Attach( KUsbMsDriveState_Category,EUsbMsDriveState_DriveStatus ));
}
else
{
@@ -130,23 +128,15 @@
TInt value( 0 );
TInt r (KErrNone);
-
- if( iKey != EWidgetMassStorageMode )
+ TUsbMsDrivesStatus allDrivesStatus;
+ if( iKey != EWidgetMMCAltered && iKey != EWidgetMassStorageMode )
{
- if (iKey == EWidgetSystemShutdown)
- GetValue( value);
- else
- iProperty.Get( KPropertyCat, iKey, value );
+ iProperty.Get( KPropertyCat, iKey, value );
}
else
{
- r = iProperty.Get( value );
+ r = iProperty.Get( allDrivesStatus );
}
-
-#ifdef _DEBUG
- RDebug::Print(_L("KEY %d VALUE %d "),iKey,value);
-#endif
-
if( r == KErrNone )
{
if( iKey == EWidgetUIState && value == 1 )
@@ -158,42 +148,9 @@
iHarvester->ClearAllOperations();
SetValue(1);
}
- else if( iKey == EWidgetUIState && value == 3 )
- {
- iHarvester->SetReinstallWidget(ETrue);
- }
- else if( iKey == EWidgetMassStorageMode )
- {
- if( value == KUsbPersonalityIdMS )
- {
-#ifdef _DEBUG
- RDebug::Print(_L("WE are in mass storage mode"));
-#endif
- iHarvester->SetMSMode(1);
- }
- else
- {
-#ifdef _DEBUG
- RDebug::Print(_L("NO LONGER in mass storage mode"));
-#endif
- iHarvester->SetMSMode(0);
- }
- }
else if( iKey == EWidgetRegAltered && value == 1 )
{
- if(iHarvester->IsInMSMode())
- {
- iHarvester->SetRegistryAccess(EFalse);
- }
- else
- {
- iHarvester->SetRegistryAccess(ETrue);
- }
- iHarvester->UpdateL();
- }
- else if( iKey == EWidgetSystemShutdown && value == ESwStateShuttingDown )
- {
- iHarvester->SetSystemShutdown(ETrue);
+ iHarvester->UpdateL();
}
}
}