From eee536046b40cad6a14ce6e1aebcf453d1679c97 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sat, 24 Apr 2021 17:40:37 +0200 Subject: [PATCH] [packagechooser] Sanitize includes - build was broken due to AppStream moving around - unnecessary includes - change name HAVE_XML -> HAVE_APPDATA for meaning --- src/modules/packagechooser/CMakeLists.txt | 2 +- src/modules/packagechooser/Config.cpp | 9 ++++++++- src/modules/packagechooser/PackageChooserViewStep.cpp | 10 ---------- src/modules/packagechooser/Tests.cpp | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/modules/packagechooser/CMakeLists.txt b/src/modules/packagechooser/CMakeLists.txt index e6c2c5b1d..f08658037 100644 --- a/src/modules/packagechooser/CMakeLists.txt +++ b/src/modules/packagechooser/CMakeLists.txt @@ -15,7 +15,7 @@ option( WITH_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" if ( WITH_APPDATA ) find_package(Qt5 COMPONENTS Xml) if ( Qt5Xml_FOUND ) - add_definitions( -DHAVE_XML ) + add_definitions( -DHAVE_APPDATA ) list( APPEND _extra_libraries Qt5::Xml ) list( APPEND _extra_src ItemAppData.cpp ) endif() diff --git a/src/modules/packagechooser/Config.cpp b/src/modules/packagechooser/Config.cpp index de5cb0813..106ae4538 100644 --- a/src/modules/packagechooser/Config.cpp +++ b/src/modules/packagechooser/Config.cpp @@ -9,10 +9,17 @@ #include "Config.h" -#ifdef HAVE_XML +#ifdef HAVE_APPDATA #include "ItemAppData.h" #endif +#ifdef HAVE_APPSTREAM +#include "ItemAppStream.h" +#include +#include +#endif + + #include "GlobalStorage.h" #include "JobQueue.h" #include "packages/Globals.h" diff --git a/src/modules/packagechooser/PackageChooserViewStep.cpp b/src/modules/packagechooser/PackageChooserViewStep.cpp index 53912ef36..9057004de 100644 --- a/src/modules/packagechooser/PackageChooserViewStep.cpp +++ b/src/modules/packagechooser/PackageChooserViewStep.cpp @@ -13,16 +13,6 @@ #include "PackageChooserPage.h" #include "PackageModel.h" -#ifdef HAVE_XML -#include "ItemAppData.h" -#endif - -#ifdef HAVE_APPSTREAM -#include "ItemAppStream.h" -#include -#include -#endif - #include "GlobalStorage.h" #include "JobQueue.h" #include "locale/TranslatableConfiguration.h" diff --git a/src/modules/packagechooser/Tests.cpp b/src/modules/packagechooser/Tests.cpp index c303f0488..1365b1452 100644 --- a/src/modules/packagechooser/Tests.cpp +++ b/src/modules/packagechooser/Tests.cpp @@ -9,7 +9,7 @@ #include "Tests.h" -#ifdef HAVE_XML +#ifdef HAVE_APPDATA #include "ItemAppData.h" #endif #ifdef HAVE_APPSTREAM