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

flatpak: fix build on old flatpak versions

parent 9c287d7c
......@@ -13,7 +13,7 @@ add_library(flatpak-backend MODULE ${flatpak-backend_SRCS})
target_link_libraries(flatpak-backend Qt5::Core Qt5::Widgets Qt5::Concurrent KF5::CoreAddons KF5::ConfigCore Discover::Common AppStreamQt PkgConfig::Flatpak)
if (NOT Flatpak_VERSION VERSION_LESS 1.1.2)
target_compile_definitions(flatpak-backend PRIVATE -DFLATPAK_VERBOSE_PROGRESS)
target_compile_definitions(flatpak-backend PRIVATE -DFLATPAK_VERBOSE_PROGRESS -DFLATPAK_LIST_UNUSED_REFS)
endif()
install(TARGETS flatpak-backend DESTINATION ${PLUGIN_INSTALL_DIR}/discover)
......
......@@ -158,6 +158,7 @@ void FlatpakTransactionThread::run()
m_result = flatpak_transaction_run(m_transaction, m_cancellable, &localError);
if (!m_result) {
m_errorMessage = QString::fromUtf8(localError->message);
#if defined(FLATPAK_LIST_UNUSED_REFS)
} else {
const auto installation = flatpak_transaction_get_installation(m_transaction);
g_autoptr(GPtrArray) refs = flatpak_installation_list_unused_refs(installation, nullptr, m_cancellable, nullptr);
......@@ -182,6 +183,7 @@ void FlatpakTransactionThread::run()
}
g_object_unref(m_transaction);
}
#endif
}
// We are done so we can set the progress to 100
setProgress(100);
......
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