'Search for an category node (a top-level node) in the tags browser list
that matches the key (exact case-insensitive match). Returns the path to
the node. Paths are as in find_item_node.'

def find_category_node(self, key, parent=QModelIndex()):

    if (not key):
        return None
    for i in xrange(self.rowCount(parent)):
        idx = self.index(i, 0, parent)
        node = self.get_node(idx)
        if (node.type == TagTreeItem.CATEGORY):
            ckey = node.category_key
            if (strcmp(ckey, key) == 0):
                return self.path_for_index(idx)
            if len(node.children):
                v = self.find_category_node(key, idx)
                if (v is not None):
                    return v
    return None
