psln/Src/PslnScreenSaverView.cpp
branchRCL_3
changeset 64 85902f042028
parent 56 d48ab3b357f1
child 72 a5e7a4f63858
--- a/psln/Src/PslnScreenSaverView.cpp	Tue Sep 14 21:48:24 2010 +0300
+++ b/psln/Src/PslnScreenSaverView.cpp	Wed Sep 15 12:29:17 2010 +0300
@@ -279,6 +279,7 @@
         self->iModel->ActivateScreenSaver(
             KErrNotFound,
             EPslnScreenSaverPreviewDeactivation );
+        self->iScreenSaverPreviewing = EFalse;
 
         if ( self->iContainer )
             {
@@ -563,6 +564,12 @@
 //
 void CPslnScreenSaverView::HandleScreenSaverActivationL( TInt aCurrentItem )
     {
+    // Protect screensaver type during preview.
+    if ( iScreenSaverPreviewing )
+        {
+        return;
+        }
+
     TInt PsmMode = 0; 
     iPsmClient->PsmSettings().GetCurrentMode( PsmMode );
     if ( PsmMode == EPsmsrvModePowerSave ) // PSM on, setting is protected
@@ -610,6 +617,12 @@
 //
 void CPslnScreenSaverView::HandleScreenSaverPreviewL( TInt aCurrentItem )
     {
+    // Stop responding to preview again if screensaver is being previewed.
+    if ( iScreenSaverPreviewing )
+        {
+        return;
+        }
+
     TRAPD( err, DoInvokeScreenSaverFunctionL(
         aCurrentItem,
         EScpCapsPreviewNotification ) );
@@ -619,7 +632,8 @@
         // Start listening for screensaver preview mode key changes.
         CreatePreviewModeSubscriberL();
         CreatePreviewStateSubscriberL();
-        
+
+        iScreenSaverPreviewing = ETrue;
         User::LeaveIfError(
             iModel->ActivateScreenSaver(
                 aCurrentItem,