[Player-dev] Re: [Midplayer-private-dev] CR-Resend: [#8076] Fixing sort menu and sort toggle button not in sync
Kinson Liu kliu at real.comHi Rusty, Thanks for answering. Actually my fix is safe from what you said. What happened was, for some reason, cvs diff -uw stripped off some necessary whitespace, making the two "else" indented out by one tab. I tried cutting and pasting the code, making sure the there are tabs instead of whitespace, but the problem still existed. Do you have any idea what I can do about? Thanks, Kinson Rusty Lynch wrote: > Crud... I sent on accident. > > Forget the last reply and now the complete reply (hopefully)... > > On Wed, Sep 3, 2008 at 4:18 AM, Rusty Lynch <rustylynch1234 at gmail.com> wrote: > <snip> > >>> =================================================================== >>> RCS file: /cvsroot/player/mid/src/toolbar_view.py,v >>> retrieving revision 1.13.4.2 >>> diff -u -w -r1.13.4.2 toolbar_view.py >>> --- src/toolbar_view.py 2 Jul 2008 20:32:43 -0000 1.13.4.2 >>> +++ src/toolbar_view.py 26 Aug 2008 21:07:13 -0000 >>> @@ -300,13 +300,13 @@ >>> if visible: >>> if sorttype == 0: >>> # Sorted by date, so show Sort by Name btn >>> - self.ph_sort_name_btn.show() >>> - self.ph_sort_date_btn.hide() >>> - else: >>> - # Sort by name, so show Sort by Date btn >>> self.ph_sort_name_btn.hide() >>> self.ph_sort_date_btn.show() >>> else: >>> + # Sort by name, so show Sort by Date btn >>> + self.ph_sort_name_btn.show() >>> + self.ph_sort_date_btn.hide() >>> + else: >>> self.ph_sort_name_btn.hide() >>> self.ph_sort_date_btn.hide() >>> elif mode == 'video': >>> >> The above patch results in ==> >> >> if visible: >> if sorttype == 0: >> # Sorted by date, so show Sort by Name btn >> self.ph_sort_name_btn.hide() >> self.ph_sort_date_btn.show() >> else: >> # Sort by name, so show Sort by Date btn >> self.ph_sort_name_btn.show() >> self.ph_sort_date_btn.hide() >> else: >> self.ph_sort_name_btn.hide() >> self.ph_sort_date_btn.hide() >> >> > ...where my cut-n-paste may make it not very obvious, but since python > works off indention level, you basically have: > > if (foo) { > if (bar) { > ... > } > } else { > ... > } else { > ... > } > > I don't think this will do what you expect. The last 'else' block is > not even reachable. > > >> @@ -314,13 +314,13 @@ >> >>> if visible: >>> if sorttype == 0: >>> # Sorted by date, so show Sort by Name btn >>> - self.vd_sort_name_btn.show() >>> - self.vd_sort_date_btn.hide() >>> - else: >>> - # Sort by name, so show Sort by Date btn >>> self.vd_sort_name_btn.hide() >>> self.vd_sort_date_btn.show() >>> else: >>> + # Sort by name, so show Sort by Date btn >>> + self.vd_sort_name_btn.show() >>> + self.vd_sort_date_btn.hide() >>> + else: >>> self.vd_sort_name_btn.hide() >>> self.vd_sort_date_btn.hide() >>> > > It looks like another similar problem here. > > --rusty > > -- ------------------------------------------------------------------------ *Kinson Liu* | Software Development Engineer | RealNetworks, Inc. | kliu at real.com | 206.892.6177 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.helixcommunity.org/pipermail/player-dev/attachments/20080904/9f748a49/attachment.html