We can not know if a service got deleted, so we clear
the model and reload the services. The issue that the entries are
not uninstalled has already been solved, this is just a patch to
fix the state of the UI.
CCBUG: 420312
return m_items.count();
}
+void ServiceModel::clear()
+{
+ beginRemoveRows(QModelIndex(), 0, m_items.count());
+ m_items.clear();
+ endRemoveRows();
+}
+
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
+ void clear();
private:
struct ServiceItem
auto *downloadButton = new KNS3::Button(i18nc("@action:button", "Download New Services..."),
QStringLiteral("servicemenu.knsrc"),
this);
- connect(downloadButton, &KNS3::Button::dialogFinished, this, &ServicesSettingsPage::loadServices);
+ connect(downloadButton, &KNS3::Button::dialogFinished, this, [this](const KNS3::Entry::List &changedEntries) {
+ if (!changedEntries.isEmpty()) {
+ m_serviceModel->clear();
+ loadServices();
+ }
+ });
+
#endif
topLayout->addWidget(label);