# HG changeset patch # User Sebastian Brannstrom # Date 1288445305 -3600 # Node ID 2faae209e72b9cbd706b970b37b802f7d542bd3e # Parent 606f4f6babf691d7226fc56cbecf27e7aa8850a3 More elegant view handling between search view and feeds view diff -r 606f4f6babf6 -r 2faae209e72b application/src/PodcastFeedView.cpp --- a/application/src/PodcastFeedView.cpp Sat Oct 30 14:06:37 2010 +0100 +++ b/application/src/PodcastFeedView.cpp Sat Oct 30 14:28:25 2010 +0100 @@ -166,15 +166,30 @@ DP("CPodcastFeedView::DoActivateL BEGIN"); CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); + + UpdateListboxItemsL(); + UpdateToolbar(); + if (aPrevViewId.iViewUid == KUidPodcastShowsViewID) { // back key from shows view iViewingShows = EFalse; } - - UpdateListboxItemsL(); - UpdateToolbar(); + // when we receive a UID argument, this comes from search view after + // a new feed has been added + if (aCustomMessageId.iUid != 0) + { + TUint feedUid = aCustomMessageId.iUid; + ShowItem(feedUid); + TBuf message; + iEikonEnv->ReadResourceL(message, R_ADD_FEED_SUCCESS); + if(ShowQueryMessageL(message)) + { + iPodcastModel.FeedEngine().UpdateFeedL(feedUid); + } + } + if (iFirstActivateAfterLaunch) { iFirstActivateAfterLaunch = EFalse; diff -r 606f4f6babf6 -r 2faae209e72b application/src/PodcastSearchView.cpp --- a/application/src/PodcastSearchView.cpp Sat Oct 30 14:06:37 2010 +0100 +++ b/application/src/PodcastSearchView.cpp Sat Oct 30 14:28:25 2010 +0100 @@ -227,14 +227,12 @@ TBool added = iPodcastModel.FeedEngine().AddFeedL(*newInfo); if (added) - { - // ask if user wants to update it now - TBuf message; - iEikonEnv->ReadResourceL(message, R_ADD_FEED_SUCCESS); - if(ShowQueryMessageL(message)) - { - iPodcastModel.FeedEngine().UpdateFeedL(newInfo->Uid()); - } + { + // this is a bit of a hack, first we activate the feeds view normally + AppUi()->ActivateLocalViewL(KUidPodcastFeedViewID, TUid::Uid(0), KNullDesC8); + // and then we send the UID of the recently added feed back to feed view for updating + // this is needed so the update? query comes on top of feed view, not search view + AppUi()->ActivateLocalViewL(KUidPodcastFeedViewID, TUid::Uid(newInfo->Uid()), KNullDesC8); } else {