Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/GuiUtils.py

    r5d28d6b r9ce69ec  
    322322    assert isinstance(item, QtGui.QStandardItem) 
    323323 
     324    # lists of plots names/ids for all deletable plots on item 
    324325    names = [p.name for p in new_plots if p.name is not None] 
    325326    ids = [p.id for p in new_plots if p.id is not None] 
     
    329330    for index in range(item.rowCount()): 
    330331        plot_item = item.child(index) 
    331         if plot_item.isCheckable(): 
    332             plot_data = plot_item.child(0).data() 
    333             if (plot_data.id is not None) and (plot_data.id not in ids) and (plot_data.name not in names): 
    334                 items_to_delete.append(plot_item) 
     332        if not plot_item.isCheckable(): 
     333            continue 
     334        plot_data = plot_item.child(0).data() 
     335        if (plot_data.id is not None) and \ 
     336            (plot_data.id not in ids) and \ 
     337            (plot_data.name not in names) and \ 
     338            (plot_data.plot_role == Data1D.ROLE_DELETABLE): 
     339            items_to_delete.append(plot_item) 
    335340 
    336341    for plot_item in items_to_delete: 
     
    562567    The assumption - data stored in SasView standard, in child 0 
    563568    """ 
    564     return item.child(0).data() 
     569    try: 
     570        data = item.child(0).data() 
     571    except AttributeError: 
     572        data = None 
     573    return data 
    565574 
    566575def openLink(url): 
Note: See TracChangeset for help on using the changeset viewer.