Code review comment for lp:~stolowski/unity8/results-nullptr-fix

Revision history for this message
Paweł Stołowski (stolowski) wrote :

> 17 + if (unity_results) {
> 18 + results->setModel(unity_results->model());
> 19 + } else {
>
> The else branch should call setModel(NULL), although I'm not sure what to do
> about the cached value in that case.
Why explicit setModel(NULL)? We are dealing with new CategoryResults object here, the model is NULL. As for cached results, I expect we will be notifed by signal, and onCategoriesModelChanged will reset all categories?

>
> 49 + m_resultshangedConnection.disconnect();
> 50 + m_resultshangedConnection =
> m_unityScope->results()->model.changed.connect(sigc::mem_fun(this,
> &Categories::onScopeResultsModelChanged));
>
> I specifically didn't want that signal, cause now we end up setting the model
> multiple times
Right. I think it's safe to assume (after looking into UnityCore - ScopeProxy.cpp) that categories changed signal is enough, since both category and results models are set under the same circumstances - on channel opening. Will remove it.

« Back to merge proposal