@@ -24,11 +24,12 @@ ScopesOverview::ScopesOverview(Scopes* parent)
24 : Scope("scopesOverview", "Scopes Overview", false, parent)
24 : Scope("scopesOverview", "Scopes Overview", false, parent)
26 delete m_categories;
26 delete m_categories;
27− m_categories = new ScopesOverviewCategories(this);
27+ m_categories = new ScopesOverviewCategories(parent, this);
30−ScopesOverviewCategories::ScopesOverviewCategories(QObject* parent)
30+ScopesOverviewCategories::ScopesOverviewCategories(Scopes *scopes, QObject* parent)
31 : unity::shell::scopes::CategoriesInterface(parent)
31 : unity::shell::scopes::CategoriesInterface(parent)
@@ -54,11 +55,10 @@ ScopesOverviewCategories::data(const QModelIndex& index, int role) const
54 return QVariant();
55 return QVariant();
58 unity::shell::scopes::ResultsModelInterface *resultsModel = m_resultsModels[index.row()];
58 unity::shell::scopes::ResultsModelInterface *resultsModel = m_resultsModels[index.row()];
59 if (!resultsModel) {
59 if (!resultsModel) {
60 QObject *that = const_cast<ScopesOverviewCategories*>(this);
60 QObject *that = const_cast<ScopesOverviewCategories*>(this);
61− resultsModel = new ScopesOverviewResultsModel(static_cast<Scopes*>(parent()), index.row() == 0, that);
61+ resultsModel = new ScopesOverviewResultsModel(m_scopes, index.row() == 0, that);
62 m_resultsModels[index.row()] = resultsModel;
62 m_resultsModels[index.row()] = resultsModel;
64 switch (role) {
64 switch (role) {