"metadata_" is defined nowhere in the code snippet

Bug #1465940 reported by XiaoGuo, Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Developer Portal
New
Undecided
Unassigned

Bug Description

https://developer.ubuntu.com/en/scopes/tutorials/scope-keywords/

the "metadata_" could be defined as follows:

auto metadata_ = search_metadata();

void MyQuery::run(SearchReplyProxy const& reply)
{
    if (metadata_.is_aggregated())
    {
        auto keywords = metadata_.aggregated_keywords();
        if (keywords.find("food") != keywords.end())
        {
            auto category = reply->register_category("food",
                                                     "CoolScope Food",
                                                     food_icon);
            do_food_search(reply, category);
        }
        else if (keywords.find("video") != keywords.end())
        {
            auto category = reply->register_category("video",
                                                     "CoolScope Videos",
                                                     videos_icon);
            do_video_search(reply, category);
        }
    }
    else
    {
        do_normal_search(reply);
    }
}

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.