~stolowski/unity-scope-click/fix-1340195

« back to all changes in this revision

Viewing changes to libclickscope/click/highlights.cpp

  • Committer: Tarmac
  • Author(s): Pawel Stolowski
  • Date: 2014-07-11 19:48:17 UTC
  • mfrom: (319.1.7 update-for-design)
  • Revision ID: tarmac-20140711194817-nc211r64i6eo94yx
Minor updates to be more in line with latest designs: use big card for app of the week, pass search string in a canned query of Ubuntu Store link.

Approved by Alejandro J. Cura, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
{
39
39
}
40
40
 
41
 
Highlight::Highlight(const std::string& name, const Packages& pkgs)
42
 
    : name_(name),
 
41
Highlight::Highlight(const std::string& slug, const std::string& name, const Packages& pkgs)
 
42
    : slug_(slug),
 
43
      name_(name),
43
44
      packages_(pkgs)
44
45
{
45
46
}
49
50
    packages_.push_back(pkg);
50
51
}
51
52
 
 
53
std::string Highlight::slug() const
 
54
{
 
55
    return slug_;
 
56
}
 
57
 
52
58
std::string Highlight::name() const
53
59
{
54
60
    return name_;
69
75
        if (item.isObject() && item.isMember(Highlight::JsonKeys::name))
70
76
        {
71
77
            auto name = item[Highlight::JsonKeys::name].asString();
 
78
            auto slug = item[Highlight::JsonKeys::slug].asString();
72
79
            auto pkg_node = item[Package::JsonKeys::embedded][Package::JsonKeys::ci_package];
73
80
            auto pkgs = package_list_from_json_node(pkg_node);
74
 
            highlights.push_back(Highlight(name, pkgs));
 
81
            highlights.push_back(Highlight(slug, name, pkgs));
75
82
        }
76
83
    }
77
84