Commit a2c0301e authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Address a few issues detected by UBSan

They're not critical or noticeable at runtime still makes sense to
handle them properly.
parent d3def74e
Pipeline #218818 passed with stage
in 1 minute and 27 seconds
......@@ -334,6 +334,11 @@ void FlatpakSourcesBackend::addRemote(FlatpakRemote *remote, FlatpakInstallation
}
for (int i = 0, c = m_sources->rowCount(); i < c; ++i) {
auto genItem = m_sources->item(i);
if (genItem == m_noSourcesItem) {
continue;
}
FlatpakSourceItem *item = static_cast<FlatpakSourceItem *>(m_sources->item(i));
if (item->data(Qt::StatusTipRole) == remoteUrl && item->flatpakInstallation() == installation) {
qDebug() << "we already have an item for this" << remoteUrl;
......
......@@ -214,6 +214,7 @@ KNSBackend::KNSBackend(QObject *parent, const QString &iconName, const QString &
};
const auto iconName = knsrcPlasma.contains(fileName) ? QStringLiteral("plasma") : QStringLiteral("applications-other");
auto actualCategory = new Category(m_displayName, iconName, filters, backendName, categories, QUrl(), true);
actualCategory->setParent(this);
const auto topLevelName = knsrcPlasma.contains(fileName) ? i18n("Plasma Addons") : i18n("Application Addons");
auto addonsCategory = new Category(topLevelName, iconName, filters, backendName, {actualCategory}, QUrl(), true);
......
......@@ -178,7 +178,12 @@ void ResourcesUpdatesModel::init()
void ResourcesUpdatesModel::updaterDestroyed(QObject *obj)
{
m_updaters.removeAll(static_cast<AbstractBackendUpdater *>(obj));
for (auto it = m_updaters.begin(); it != m_updaters.end();) {
if (*it == obj)
it = m_updaters.erase(it);
else
++it;
}
}
void ResourcesUpdatesModel::message(const QString &msg)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment