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

fwupd: Show the error to the user, they will appreciate an insight

CCBUG: 455132
parent cc0fc02a
Pipeline #209416 passed with stage
in 1 minute and 5 seconds
......@@ -128,13 +128,13 @@ void FwupdSourcesBackend::cancel()
void FwupdSourcesBackend::proceed()
{
FwupdRemote *remote =
fwupd_client_get_remote_by_id(backend->client, m_currentItem->data(AbstractSourcesBackend::IdRole).toString().toUtf8().constData(), nullptr, nullptr);
const QString id = m_currentItem->data(AbstractSourcesBackend::IdRole).toString();
FwupdRemote *remote = fwupd_client_get_remote_by_id(backend->client, id.toUtf8().constData(), nullptr, nullptr);
g_autoptr(GError) error = nullptr;
if (fwupd_client_modify_remote(backend->client, fwupd_remote_get_id(remote), "Enabled", "true", nullptr, &error))
m_currentItem->setData(Qt::Checked, Qt::CheckStateRole);
else
qWarning() << "could not enable remote" << remote << (error ? error->message : "");
Q_EMIT passiveMessage(i18n("Could not enable remote %1: %2", id, (error ? error->message : "")));
m_currentItem = nullptr;
}
......
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