Changeset 515c23df in sasview


Ignore:
Timestamp:
Jul 9, 2018 5:17:19 AM (6 years ago)
Author:
Torin Cooper-Bennun <torin.cooper-bennun@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
d9150d8, 6052c02
Parents:
05fa132
Message:

fixed deleteItem behaviour as per SASVIEW-956 discussion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    rb1a7a81 r515c23df  
    3030 
    3131DEFAULT_PERSPECTIVE = "Fitting" 
     32 
     33logger = logging.getLogger(__name__) 
    3234 
    3335class DataExplorerWindow(DroppableDataLoadWidget): 
     
    296298        ind = -1 
    297299        # Use 'while' so the row count is forced at every iteration 
    298         deleted_indices = [] 
     300        deleted_items = [] 
    299301        deleted_names = [] 
    300302        while ind < self.model.rowCount(): 
     
    305307                # Delete these rows from the model 
    306308                deleted_names.append(str(self.model.item(ind).text())) 
    307                 deleted_indices.append(item) 
     309                deleted_items.append(item) 
    308310 
    309311                self.model.removeRow(ind) 
     
    312314 
    313315        # Let others know we deleted data 
    314         self.communicator.dataDeletedSignal.emit(deleted_indices) 
     316        self.communicator.dataDeletedSignal.emit(deleted_items) 
    315317 
    316318        # update stored_data 
     
    10271029        model = proxy.sourceModel() 
    10281030 
    1029         deleted_indices = [] 
     1031        deleted_items = [] 
    10301032        deleted_names = [] 
    10311033 
     
    10421044 
    10431045                # store the deleted item details so we can pass them on later 
    1044                 deleted_names.append(str(self.model.item(row).text())) 
    1045                 deleted_indices.append(self.model.item(row)) 
     1046                deleted_names.append(item_to_delete.text()) 
     1047                deleted_items.append(item_to_delete) 
    10461048 
    10471049                if item_to_delete.parent(): 
     
    10541056 
    10551057        # Let others know we deleted data 
    1056         self.communicator.dataDeletedSignal.emit(deleted_indices) 
     1058        self.communicator.dataDeletedSignal.emit(deleted_items) 
    10571059 
    10581060        # update stored_data 
Note: See TracChangeset for help on using the changeset viewer.