#10771 NORM 11.2.0-: Paint undo functionality with clippings seems to often cause duplication

Zarro Boogs per Child bugtracker at laptop.org
Thu Jun 16 11:17:26 EDT 2011


#10771: Paint undo functionality with clippings seems to often cause duplication
--------------------------------------------------------+-------------------
           Reporter:  greenfeld                         |       Owner:  godiard                          
               Type:  defect                            |      Status:  new                              
           Priority:  normal                            |   Milestone:  11.2.0-M3                        
          Component:  paint/drawing-activity (oficina)  |     Version:  Development build as of this date
         Resolution:                                    |    Keywords:                                   
        Next_action:  code                              |    Verified:  0                                
Deployment_affected:                                    |   Blockedby:                                   
           Blocking:                                    |  
--------------------------------------------------------+-------------------
Changes (by godiard):

  * next_action:  review => code


Comment:

 Manu:

 Good work, I am very happy when we remove code :) And the remaining code
 works better!

 I have a few comments:

  * In line 1199 there are a remaining line "self.undo_times -= 1"

  * This:

 {{{
 +        if self.undo_index == 0:
 +            # first undo:
 +            pass
 +        elif self.undo_index > 0:
 +            self.undo_index -= 1
 }}}
 can be:
 {{{
 +        if self.undo_index > 0:
 +            self.undo_index -= 1
 }}}
 right?

  * I know is old code, but we can replace:

 {{{
 +        elif len(self.undo_list) == 12:
 by
 +        elif len(self.undo_list) == MAX_UNDO_STEPS:
 }}}
 and define a constant.

  * Is possible remove undo_index and use len(undo_list) ?

  * There are a few uses of undo_times in Desenho.py

 {{{
 Desenho.py:                #destroy the undo screen of polygon start
 Desenho.py:                widget.undo_times -= 1
 Desenho.py:                #destroy the undo screen of polygon start
 Desenho.py:                widget.undo_times -= 1
 }}}

  * Is a good opportunity to rename self.undo_index/self.undo_list to
 self._undo_index/self._undo_list

-- 
Ticket URL: <http://dev.laptop.org/ticket/10771#comment:4>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list