mpx/collectionframework/collectionutility/src/mpxcollectionplaylist.cpp
changeset 32 edd273b3192a
parent 0 a2952bb97e68
child 38 959ca709b049
equal deleted inserted replaced
27:cbb1bfb7ebfb 32:edd273b3192a
  1254         affectedIndex = iPath->Index();
  1254         affectedIndex = iPath->Index();
  1255         // Deleted
  1255         // Deleted
  1256         if( changeType == EMPXItemDeleted )
  1256         if( changeType == EMPXItemDeleted )
  1257             {
  1257             {
  1258             refresh = ETrue;
  1258             refresh = ETrue;
       
  1259             MPX_DEBUG1("CMPXCollectionPlaylist::DoHandleCollectionChangeMessageL -- current item deleted");
       
  1260             
       
  1261             TBool lastItemDeleted( iItemIndex == 0 && iItemIndexes.Count() == 1 );
       
  1262             
       
  1263             if ( lastItemDeleted ) // playlist is now empty, notify observer immediately
       
  1264                 {
       
  1265                 MPX_DEBUG1("CMPXCollectionPlaylist::DoHandleCollectionChangeMessageL -- last playlist item deleted");
       
  1266                 Invalidate();
       
  1267                 if ( iPlObs )
       
  1268                     {
       
  1269                     iPlObs->HandleCollectionPlaylistChange(KErrEof);
       
  1270                     }
       
  1271                 }
  1259             }
  1272             }
  1260         // Modified
  1273         // Modified
  1261         else if( changeType == EMPXItemModified )
  1274         else if( changeType == EMPXItemModified )
  1262             {
  1275             {
  1263             MPX_DEBUG1("CMPXCollectionPlaylist::DoHandleCollectionChangeMessageL -- modified");
  1276             MPX_DEBUG1("CMPXCollectionPlaylist::DoHandleCollectionChangeMessageL -- modified");
  1331                 refresh = ETrue;   
  1344                 refresh = ETrue;   
  1332                 }
  1345                 }
  1333             }
  1346             }
  1334         }
  1347         }
  1335 
  1348 
  1336     if (iAutoPlaylist && refresh)
  1349     // update playlist immediately when item is deleted in order to detect deletion of the last item in the playlist
       
  1350     if ( refresh && iItemIndexes.Count() > 0 )
  1337         {
  1351         {
  1338         // For autoplaylist, affected by the event.
  1352         // For autoplaylist, affected by the event.
  1339         // Path clip will never happen for autoplaylist
  1353         // Path clip will never happen for autoplaylist
  1340         if (changeType == EMPXItemDeleted)
  1354         if (changeType == EMPXItemDeleted)
  1341             {
  1355             {