Skip to content

fix wrong recreated history causing wrong sort order (viewstate not foun... #1985

Merged
merged 1 commit into from Dec 27, 2012

4 participants

@Voyager1
Team Kodi member

...d in db)

This issue fixes trac http://trac.xbmc.org/ticket/13777
CGUIMediaWindow::SetHistoryForPath "recreates" a history for use by the back key in case we jump right into a given path. For example if we jump to videodb://2/2/7/-2/?tvshowid=7 (an actual example from my tests) then SetHistoryForPath is constructing a history like this: videodb://2/2/7/?tvshowid=7; videodb://2/2/?tvshowid=7; videodb://2/?tvshowid=7; videodb://?tvshowid=7. The option part (after the ?) is maintained since URIUtils::GetParentPath does only modify the middle part (file). The consequence of this is that when using back, we're looking for the wrong saved viewstate, hence the sort order changes from what was originally set.

The obvious solution is to clear the option part when getting the parent path (only in the condition of being called by SetHistoryForPath). This does not seem to be dangerous, for the reason that it only affects the "recreated history" when accessing a library path directly.

@Montellese
Team Kodi member

Looks alright to me. I tried to reproduce it but didn't really manage to and now I also know why. I always use the back key to navigate back to home so I never really jump right into a sub-directory of the library.
At first I was concerned about library nodes where we rely on those URL options but it seems like we don't jump directly into those nodes from the home menu so it's not really an issue.

@Voyager1
Team Kodi member

@jmarshallnz - could you please weigh in, and
@davilla - if everyone ok, are you in agreement to pull this into Frodo?

@davilla
davilla commented Dec 25, 2012

if @jmarshallnz agrees, inject it

@jmarshallnz
Team Kodi member

I'd prefer that the option clearing is done in SetHistoryForPath instea, as it is not applicable to getting the parent path in general.

@Voyager1
Team Kodi member

addressed @jmarshallnz 's comments. Injecting.

@Voyager1 Voyager1 merged commit 84fe311 into xbmc:master Dec 27, 2012
@Voyager1 Voyager1 deleted the Voyager1:fix_trac_13777 branch May 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.