'Search all User categories for items named item_name with category
item_category and rename them to new_name. The caller must arrange to
redisplay the tree as appropriate.'

def rename_item_in_all_user_categories(self, item_name, item_category, new_name):

    user_cats = self.db.prefs.get(u'user_categories', {})
    for k in user_cats.keys():
        new_contents = []
        for tup in user_cats[k]:
            if ((tup[0] == item_name) and (tup[1] == item_category)):
                new_contents.append([new_name, item_category, 0])
            else:
                new_contents.append(tup)
        user_cats[k] = new_contents
    self.db.new_api.set_pref(u'user_categories', user_cats)
