Skip to content
Snippets Groups Projects
Commit 3b77118b authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

[ #36988 ] Try to prevent recursive contact view layout updates

parent c456ce6e
No related branches found
No related tags found
No related merge requests found
...@@ -169,11 +169,11 @@ TopLevelItem* ContactProxyModel::getTopLevelItem(const QString& category) ...@@ -169,11 +169,11 @@ TopLevelItem* ContactProxyModel::getTopLevelItem(const QString& category)
TopLevelItem* item = new TopLevelItem(category); TopLevelItem* item = new TopLevelItem(category);
m_hCategories[category] = item; m_hCategories[category] = item;
item->m_Index = m_lCategoryCounter.size(); item->m_Index = m_lCategoryCounter.size();
emit layoutAboutToBeChanged(); // emit layoutAboutToBeChanged();
beginInsertRows(QModelIndex(),m_lCategoryCounter.size(),m_lCategoryCounter.size()); { beginInsertRows(QModelIndex(),m_lCategoryCounter.size(),m_lCategoryCounter.size()); {
m_lCategoryCounter << item; m_lCategoryCounter << item;
} endInsertRows(); } endInsertRows();
emit layoutChanged(); // emit layoutChanged();
} }
TopLevelItem* item = m_hCategories[category]; TopLevelItem* item = m_hCategories[category];
return item; return item;
...@@ -181,6 +181,7 @@ TopLevelItem* ContactProxyModel::getTopLevelItem(const QString& category) ...@@ -181,6 +181,7 @@ TopLevelItem* ContactProxyModel::getTopLevelItem(const QString& category)
void ContactProxyModel::reloadCategories() void ContactProxyModel::reloadCategories()
{ {
emit layoutAboutToBeChanged();
beginResetModel(); beginResetModel();
m_hCategories.clear(); m_hCategories.clear();
foreach(TopLevelItem* item,m_lCategoryCounter) { foreach(TopLevelItem* item,m_lCategoryCounter) {
...@@ -438,7 +439,7 @@ QModelIndex ContactProxyModel::index( int row, int column, const QModelIndex& pa ...@@ -438,7 +439,7 @@ QModelIndex ContactProxyModel::index( int row, int column, const QModelIndex& pa
} }
else if (row < m_lCategoryCounter.size()){ else if (row < m_lCategoryCounter.size()){
//Return top level //Return top level
return createIndex(row,column,m_lCategoryCounter[row]); return createIndex(row,column,(void*)m_lCategoryCounter[row]);
} }
return QModelIndex(); return QModelIndex();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment