[Bugs] #2229 UNSP: Using Journal to rename an entry sets entry size to "Empty" when sort mode is "View by size"

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Sun Sep 5 00:27:56 EDT 2010


#2229: Using Journal to rename an entry sets entry size to "Empty" when sort mode
is "View by size"
------------------------------------------+---------------------------------
    Reporter:  garycmartin                |          Owner:  aa          
        Type:  defect                     |         Status:  assigned    
    Priority:  Unspecified by Maintainer  |      Milestone:  0.90        
   Component:  journal                    |        Version:  Unspecified 
    Severity:  Major                      |       Keywords:  dextrose, r?
Distribution:  Unspecified                |   Status_field:  Assigned    
------------------------------------------+---------------------------------
Changes (by aa):

 * cc: alsroot (added)
  * keywords:  dextrose => dextrose, r?


Comment:

 This bug is caused by the journal calling model.write with a default
 file_path argument:

 {{{
     def __cell_title_edited_cb(self, cell, path, new_text):
         row = self._model[path]
         metadata = model.get(row[ListModel.COLUMN_UID])
         metadata['title'] = new_text
         model.write(metadata, update_mtime=False)
         self.cell_title.props.editable = False
 }}}

 The default_file path is '', and so the filesize is updated with an
 inexistent file.

 {{{
 def write(metadata, file_path='', update_mtime=True,
 transfer_ownership=True):
 ...
          if metadata.get('uid', ''):
              object_id = _get_datastore().update(metadata['uid'],
 dbus.Dictionary(metadata),
                                                   file_path,
                                                   transfer_ownership)
 }}}

 The attached patch fixes this.

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/2229#comment:6>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list