on xenial help sign in
Don't connect to results model change signal.
7802645Pawel Stolowski
plugins/Unity/categories.cpp+4−6
@@ -67,10 +67,11 @@ Categories::getResults(int index) const
67 results->setModel(unity_results->model());
67 results->setModel(unity_results->model());
68 } else {
68 } else {
69 // No results model returned by unity core; this can be the case when the global
69 // No results model returned by unity core; this can be the case when the global
70− // results model of this scope became invalid in unity core. Don't set backend
70+ // results model of this scope is still not set in unity core. Don't set backend
71 // model in DeeListModel - it will still beahve properly as an empty model. Since
71 // model in DeeListModel - it will still beahve properly as an empty model. Since
72− // we're connected to the results model change signal, we'll reset category models
72+ // we're connected to the category model change signal, and it is set by unity core
73− // when results model is set again.
73+ // at the same time as results model (on channel opening), we'll reset category
74+ // results models with proper models when we're notifed again.
74 qWarning() << "No results model for category" << categoryIndex;
75 qWarning() << "No results model for category" << categoryIndex;
75 }
76 }
76
77
@@ -109,9 +110,6 @@ Categories::setUnityScope(const unity::dash::Scope::Ptr& scope)
109 m_categoriesChangedConnection.disconnect();
110 m_categoriesChangedConnection.disconnect();
110 m_categoriesChangedConnection =
111 m_categoriesChangedConnection =
111 m_unityScope->categories()->model.changed.connect(sigc::mem_fun(this, &Categories::onCategoriesModelChanged));
112 m_unityScope->categories()->model.changed.connect(sigc::mem_fun(this, &Categories::onCategoriesModelChanged));
112−
113− m_resultsChangedConnection.disconnect();
114− m_resultsChangedConnection = m_unityScope->results()->model.changed.connect(sigc::mem_fun(this, &Categories::onScopeResultsModelChanged));
115}
113}
116
114
117void
115void
plugins/Unity/categories.h−1
@@ -81,7 +81,6 @@ private:
81 QMap<QString, QAbstractItemModel*> m_overriddenCategories;
81 QMap<QString, QAbstractItemModel*> m_overriddenCategories;
82 mutable QMap<int, DeeListModel*> m_results;
82 mutable QMap<int, DeeListModel*> m_results;
83 sigc::connection m_categoriesChangedConnection;
83 sigc::connection m_categoriesChangedConnection;
84− sigc::connection m_resultsChangedConnection;
85};
84};
86
85
87#endif // CATEGORIES_H
86#endif // CATEGORIES_H