(self, index)
Activate an item from the recent list.
Activate an item from the recent list.
Activate an item from the recent list .
def activate_recent(self, index):
        """
        Activate an item from the recent list.
        """
        model = self.import_items_model
        cb = self.recent_combo
        if 0 <= index < model.rowCount():
            item = model.item(index)
            assert isinstance(item, ImportItem)
            path = item.path()
            item.setData(True, ImportItem.IsSessionItemRole)
            move_item_to_index(model, item, 0)
            if not os.path.exists(path):
                self._browse_for_missing(
                    item, onfinished=lambda status: self._invalidate()
                )
            else:
                cb.setCurrentIndex(0)
                self._invalidate()
        else:
            self.recent_combo.setCurrentIndex(-1)
def activate_recent ( self , index ) : model = self . import_items_model cb = self . recent_combo if 0 <= index < model . rowCount ( ) : item = model . item ( index ) assert isinstance ( item , ImportItem ) path = item . path ( ) item . setData ( True , ImportItem . IsSessionItemRole ) move_item_to_index ( model , item , 0 ) if not os . path . exists ( path ) : self . _browse_for_missing ( item , onfinished = lambda status : self . _invalidate ( ) ) else : cb . setCurrentIndex ( 0 ) self . _invalidate ( ) else : self . recent_combo . setCurrentIndex ( - 1 )