Commit baac08a4 authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen Committed by Nate Graham

Set parent on newly created fwupd resource

Without this patch, the resource lacks a parent backend, which
causes issues when attempting to signal changes in it later on
(as AbstractResource depends on there being a backend set)

BUG:402328
Differential Revision: https://phabricator.kde.org/D18946
parent 003fc9fc
......@@ -85,7 +85,7 @@ void FwupdBackend::addResourceToList(FwupdResource* res)
FwupdResource * FwupdBackend::createDevice(FwupdDevice *device)
{
const QString name = QString::fromUtf8(fwupd_device_get_name(device));
FwupdResource* res = new FwupdResource(name, nullptr);
FwupdResource* res = new FwupdResource(name, this);
const QString deviceID = QString::fromUtf8(fwupd_device_get_id(device));
res->setId(QStringLiteral("org.fwupd.%1.device").arg(QString(deviceID).replace(QLatin1Char('/'),QLatin1Char('_'))));
......
......@@ -94,7 +94,7 @@ private:
static QByteArray getChecksum(const QString &filename, QCryptographicHash::Algorithm hashAlgorithm);
static bool downloadFile(const QUrl &uri, const QString &filename);
static FwupdResource * createDevice(FwupdDevice *device);
FwupdResource * createDevice(FwupdDevice *device);
FwupdResource * createRelease(FwupdDevice *device);
FwupdResource * createApp(FwupdDevice *device);
......
Markdown is supported
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