mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-28 22:04:44 +00:00

This only runs on Arch to avoid giving the extra dependencies to all the distro CI builds.
33 lines
727 B
C++
33 lines
727 B
C++
/*
|
|
* Copyright (C) 2020 Aleix Pol <aleixpol@kde.org>
|
|
*
|
|
* SPDX-License-Identifier: LGPL-2.1+
|
|
*/
|
|
|
|
extern "C" {
|
|
#include <fwupd.h>
|
|
}
|
|
|
|
#include <QCoreApplication>
|
|
#include <QtConcurrentRun>
|
|
#include <QFutureWatcher>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
QCoreApplication app(argc, argv);
|
|
|
|
auto client = fwupd_client_new();
|
|
auto cancellable = g_cancellable_new();
|
|
g_autoptr(GError) error = nullptr;
|
|
|
|
auto fw = new QFutureWatcher<GPtrArray*>(&app);
|
|
QObject::connect(fw, &QFutureWatcher<GPtrArray*>::finished, [fw]() {
|
|
QCoreApplication::exit(0);
|
|
});
|
|
fw->setFuture(QtConcurrent::run([&] {
|
|
return fwupd_client_get_devices(client, cancellable, &error);
|
|
}));
|
|
|
|
return app.exec();
|
|
}
|