'Load expanded items from a dict'

def load_state(self, item, state):

    if (len(state.keys()) > 0):
        item.setExpanded(True)
    for i in range(item.childCount()):
        child = item.child(i)
        if (child.name in state):
            self.load_state(child, state[child.name])
