From 850b058ecd1f453ac22dd0ad717fab1dc1ee0387 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 21 Mar 2020 01:54:45 +0200 Subject: [PATCH] fix layouts data broadcasting when applying --- app/settings/models/layoutsmodel.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/app/settings/models/layoutsmodel.cpp b/app/settings/models/layoutsmodel.cpp index 8660777a9..f39086764 100644 --- a/app/settings/models/layoutsmodel.cpp +++ b/app/settings/models/layoutsmodel.cpp @@ -136,17 +136,6 @@ void Layouts::appendLayout(const Settings::Data::Layout &layout) void Layouts::applyData() { - bool appending{false}; - bool removing{false}; - - if (o_layoutsTable.rowCount() > m_layoutsTable.rowCount()) { - removing = true; - beginRemoveRows(QModelIndex(), o_layoutsTable.rowCount(), m_layoutsTable.rowCount()-1); - } else if (o_layoutsTable.rowCount() < m_layoutsTable.rowCount()){ - appending = true; - beginInsertRows(QModelIndex(), o_layoutsTable.rowCount(), m_layoutsTable.rowCount()-1); - } - QVector roles; roles << Qt::DisplayRole; roles << Qt::UserRole; @@ -154,13 +143,7 @@ void Layouts::applyData() o_inMultipleMode = m_inMultipleMode; o_layoutsTable = m_layoutsTable; - if (appending) { - endInsertRows(); - } else if (removing) { - endRemoveRows(); - } - - emit dataChanged(index(0, NAMECOLUMN), index(rowCount()-1,NAMECOLUMN), roles); + emit dataChanged(index(0, BACKGROUNDCOLUMN), index(rowCount()-1,SHAREDCOLUMN), roles); } void Layouts::resetData()