summaryrefslogtreecommitdiff
diff options
-rw-r--r--dash/LensView.cpp5
-rw-r--r--dash/ResultView.cpp9
2 files changed, 8 insertions, 6 deletions
diff --git a/dash/LensView.cpp b/dash/LensView.cpp
index baa23bdf9..2d0acfcf0 100644
--- a/dash/LensView.cpp
+++ b/dash/LensView.cpp
@@ -279,6 +279,8 @@ void LensView::OnCategoryAdded(Category const& category)
<< ", " << renderer_name
<< ", " << boost::lexical_cast<int>(index) << ")";
+ // FIXME: duplicating PlacesGroups when lens crashes and restarts!
+
PlacesGroup* group = new PlacesGroup();
AddChild(group);
group->SetName(name);
@@ -320,6 +322,9 @@ void LensView::OnCategoryAdded(Category const& category)
if (reset_filter_models)
{
+ /* HomeLens is reodering the categories, and since their index is based
+ * on the row position in the model, we need to re-initialize the filter
+ * models if we got insert and not an append */
for (auto it = categories_.begin() + (index + 1); it != categories_.end(); ++it)
{
grid = static_cast<ResultViewGrid*>((*it)->GetChildView());
diff --git a/dash/ResultView.cpp b/dash/ResultView.cpp
index 6dd5d5d9d..88f959337 100644
--- a/dash/ResultView.cpp
+++ b/dash/ResultView.cpp
@@ -56,13 +56,10 @@ ResultView::~ResultView()
{
ClearIntrospectableWrappers();
- if (result_model_)
+ for (ResultIterator iter(GetIteratorAtRow(0)); !iter.IsLast(); ++iter)
{
- for (ResultIterator iter(result_model_); !iter.IsLast(); ++iter)
- {
- Result result(*iter);
- renderer_->Unload(result);
- }
+ Result result(*iter);
+ renderer_->Unload(result);
}
renderer_->UnReference();