~unity-team/unity-scopes-shell/drop-fill-mode

« back to all changes in this revision

Viewing changes to src/Unity/categories.cpp

  • Committer: CI bot
  • Author(s): Michal Hruby
  • Date: 2014-07-10 07:51:28 UTC
  • mfrom: (104.1.5 unity-scopes-shell)
  • Revision ID: ps-jenkins@lists.canonical.com-20140710075128-igbw8b1izi7a910d
Expose expansion queries as defined in latest unity-api. 
Approved by: Pete Woods

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
            QString::fromStdString(m_category->icon()) : m_catIcon;
90
90
    }
91
91
 
 
92
    QString headerLink() const
 
93
    {
 
94
        return m_category && m_category->query() ?
 
95
            QString::fromStdString(m_category->query()->to_uri()) : QString();
 
96
    }
 
97
 
92
98
    std::string rawTemplate() const
93
99
    {
94
100
        return m_rawTemplate;
144
150
        if (category->icon() != m_category->icon()) {
145
151
            roles.append(Categories::RoleIcon);
146
152
        }
 
153
        std::string oldQuery;
 
154
        std::string newQuery;
 
155
        if (m_category->query()) {
 
156
            oldQuery = m_category->query()->to_uri();
 
157
        }
 
158
        if (category->query()) {
 
159
            newQuery = category->query()->to_uri();
 
160
        }
 
161
        if (oldQuery != newQuery) {
 
162
            roles.append(Categories::RoleHeaderLink);
 
163
        }
147
164
        if (category->renderer_template().data() != m_rawTemplate) {
148
165
            roles.append(Categories::RoleRawRendererTemplate);
149
166
 
490
507
            return catData->rendererTemplate().toVariant();
491
508
        case RoleComponents:
492
509
            return catData->components().toVariant();
 
510
        case RoleHeaderLink:
 
511
            return catData->headerLink();
493
512
        case RoleResults:
494
513
            return QVariant::fromValue(resultsModel);
495
514
        case RoleCount: