'Save all items expanded state'

def save_expanded_state(self):

    model = self.model()
    if (model is not None):
        self.__expanded_state = []
        for idx in model.persistentIndexList():
            if self.isExpanded(idx):
                self.__expanded_state.append(self.get_filename(idx))
