[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
#include "ItemAppStream.h"
#include <AppStreamQt/pool.h>
#include <memory>
#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 "utils/Logger.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
static inline quint64
sizeOrder( const QSize& size )

View File

@ -12,10 +12,28 @@
#include "PackageModel.h"
namespace AppStream
{
class Pool;
} // namespace AppStream
/*
* This weird include mechanism is because an #include line is allowed
* to consist of preprocessor-tokens, which are expanded, and then
* 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.
*