1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 13:33:50 +03:00

inform controller for inserted rows

This commit is contained in:
Michail Vourlakos 2020-03-16 11:40:23 +02:00
parent 00f4e4cd22
commit bddc04d371
3 changed files with 7 additions and 1 deletions

View File

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

View File

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

View File

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