inform controller for inserted rows

pull/11/head
Michail Vourlakos 5 years ago
parent 00f4e4cd22
commit bddc04d371

@ -68,6 +68,7 @@ Layouts::Layouts(QDialog *parent, Latte::Corona *corona, QTableView *view)
loadLayouts(); loadLayouts();
connect(m_model, &QAbstractItemModel::dataChanged, this, &Layouts::dataChanged); connect(m_model, &QAbstractItemModel::dataChanged, this, &Layouts::dataChanged);
connect(m_model, &Model::Layouts::rowsInserted, this, &Layouts::dataChanged);
} }
Layouts::~Layouts() Layouts::~Layouts()

@ -119,6 +119,8 @@ void Layouts::appendLayout(const Settings::Data::Layout &layout)
beginInsertRows(QModelIndex(), m_layoutsTable.rowCount(), m_layoutsTable.rowCount()); beginInsertRows(QModelIndex(), m_layoutsTable.rowCount(), m_layoutsTable.rowCount());
m_layoutsTable << layout; m_layoutsTable << layout;
endInsertRows(); endInsertRows();
emit rowsInserted();
} }
void Layouts::applyCurrentNames() void Layouts::applyCurrentNames()
@ -140,7 +142,7 @@ void Layouts::removeLayout(const QString &id)
if (index >= 0) { if (index >= 0) {
beginRemoveRows(QModelIndex(), index, index); beginRemoveRows(QModelIndex(), index, index);
m_layoutsTable.remove(index); m_layoutsTable.remove(index);
endInsertRows(); endRemoveRows();
} }
} }
@ -643,6 +645,8 @@ void Layouts::setCurrentData(Data::LayoutsTable &data)
beginInsertRows(QModelIndex(), 0, data.rowCount() - 1); beginInsertRows(QModelIndex(), 0, data.rowCount() - 1);
m_layoutsTable = data; m_layoutsTable = data;
endInsertRows(); endInsertRows();
emit rowsInserted();
} }
} }

@ -101,6 +101,7 @@ public:
signals: signals:
void inMultipleModeChanged(); void inMultipleModeChanged();
void rowsInserted();
private slots: private slots:
void updateActiveStates(); void updateActiveStates();

Loading…
Cancel
Save