~nick-dedekind/unity8/indicator.submenu-reinit

« back to all changes in this revision

Viewing changes to plugins/Unity/Indicators/unitymenumodelstack.cpp

  • Committer: Nick Dedekind
  • Date: 2013-09-27 10:58:50 UTC
  • Revision ID: nicholas.dedekind@gmail.com-20130927105850-bn63jchxqsij63d0
Added count to unitymenumodelstack

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
    return !m_menuModels.isEmpty() ? m_menuModels.last()->model() : NULL;
111
111
}
112
112
 
 
113
int UnityMenuModelStack::count() const
 
114
{
 
115
    return m_menuModels.count();
 
116
}
 
117
 
113
118
void UnityMenuModelStack::push(UnityMenuModel* model, int index)
114
119
{
115
120
    UnityMenuModelEntry* entry = new UnityMenuModelEntry(model, tail(), index);
117
122
 
118
123
    m_menuModels << entry;
119
124
    Q_EMIT tailChanged(model);
 
125
    Q_EMIT countChanged(m_menuModels.count());
120
126
}
121
127
 
122
128
UnityMenuModel* UnityMenuModelStack::pop()
132
138
    if (m_menuModels.isEmpty()) {
133
139
        Q_EMIT headChanged(NULL);
134
140
    }
 
141
    Q_EMIT countChanged(m_menuModels.count());
135
142
 
136
143
    return model;
137
144
}