fwupd/contrib/ci/qt5-thread-test/qt-thread-test.cpp
Richard Hughes 2002bd5046 trivial: Fix a compile failure with new GLib versions
GLib now 'helpfully' includes type_traits in gmacros.h -- which now explodes
when compiling with a C++ compiler.
2021-03-21 20:18:34 +00:00

31 lines
712 B
C++

/*
* Copyright (C) 2020 Aleix Pol <aleixpol@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#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();
}