[packagechooser] Use the found-directory for AppStream headers

This commit is contained in:
Adriaan de Groot 2024-01-01 21:45:48 +01:00
parent 94bc244965
commit 062171a2f0
3 changed files with 25 additions and 12 deletions

View File

@ -16,7 +16,6 @@
#ifdef HAVE_APPSTREAM_VERSION #ifdef HAVE_APPSTREAM_VERSION
#include "ItemAppStream.h" #include "ItemAppStream.h"
#include <AppStreamQt/pool.h>
#include <memory> #include <memory>
#endif #endif

View File

@ -7,20 +7,16 @@
* *
*/ */
/** @brief Loading items from AppData XML files. /** @brief Loading items from AppStream database.
* *
* Only used if QtXML is found, implements PackageItem::fromAppData(). * Only used if AppStreamQt is found, implements PackageItem::fromAppStream().
*/ */
#include "PackageModel.h" #include "ItemAppStream.h"
#include "locale/TranslationsModel.h" #include "locale/TranslationsModel.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "utils/Variant.h" #include "utils/Variant.h"
#include <AppStreamQt/image.h>
#include <AppStreamQt/pool.h>
#include <AppStreamQt/screenshot.h>
/// @brief Return number of pixels in a size, for < ordering purposes /// @brief Return number of pixels in a size, for < ordering purposes
static inline quint64 static inline quint64
sizeOrder( const QSize& size ) sizeOrder( const QSize& size )

View File

@ -12,10 +12,28 @@
#include "PackageModel.h" #include "PackageModel.h"
namespace AppStream /*
{ * This weird include mechanism is because an #include line is allowed
class Pool; * to consist of preprocessor-tokens, which are expanded, and then
} // namespace AppStream * the #include is *re*processed. But if it starts with < or ", then
* preprocessor tokens are not expanded. So we build up a #include <>
* style line with a suitable path -- if we are given a value for
* HAVE_APPSTREAM_HEADERS, that is the directory that the AppStreamQt
* headers live in.
*/
#define CALAMARES_LT <
#define CALAMARES_GT >
#ifndef HAVE_APPSTREAM_HEADERS
#define HAVE_APPSTREAM_HEADERS AppStreamQt
#endif
#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/pool.h CALAMARES_GT
#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/image.h CALAMARES_GT
#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/screenshot.h CALAMARES_GT
#undef CALAMARES_LT
#undef CALAMARES_GT
/** @brief Loads an item from AppStream data. /** @brief Loads an item from AppStream data.
* *