packagechooser: rename #define for AppStreamQt

Make explicit that it is set to a version (if it is defined at all).
This commit is contained in:
Adriaan de Groot 2023-10-30 00:37:38 +01:00
parent 350be92cd1
commit a6dd49ac07
4 changed files with 6 additions and 6 deletions

View File

@ -35,7 +35,7 @@ if(BUILD_APPSTREAM)
TYPE OPTIONAL
)
if(AppStreamQt_FOUND)
add_definitions(-DHAVE_APPSTREAM)
add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt_VERSION_MAJOR})
list(APPEND _extra_libraries AppStreamQt)
list(APPEND _extra_src ItemAppStream.cpp)
endif()

View File

@ -14,7 +14,7 @@
#include "ItemAppData.h"
#endif
#ifdef HAVE_APPSTREAM
#ifdef HAVE_APPSTREAM_VERSION
#include "ItemAppStream.h"
#include <AppStreamQt/pool.h>
#include <memory>
@ -257,7 +257,7 @@ fillModel( PackageListModel* model, const QVariantList& items )
return;
}
#ifdef HAVE_APPSTREAM
#ifdef HAVE_APPSTREAM_VERSION
std::unique_ptr< AppStream::Pool > pool;
bool poolOk = false;
#endif
@ -284,7 +284,7 @@ fillModel( PackageListModel* model, const QVariantList& items )
}
else if ( item_map.contains( "appstream" ) )
{
#ifdef HAVE_APPSTREAM
#ifdef HAVE_APPSTREAM_VERSION
if ( !pool )
{
pool = std::make_unique< AppStream::Pool >();

View File

@ -12,7 +12,7 @@
#ifdef HAVE_APPDATA
#include "ItemAppData.h"
#endif
#ifdef HAVE_APPSTREAM
#ifdef HAVE_APPSTREAM_VERSION
#include "ItemAppStream.h"
#endif
#include "PackageModel.h"

View File

@ -46,7 +46,7 @@ if(BUILD_APPSTREAM)
TYPE OPTIONAL
)
if(AppStreamQt_FOUND)
add_definitions(-DHAVE_APPSTREAM)
add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt_VERSION_MAJOR})
list(APPEND _extra_libraries AppStreamQt)
list(APPEND _extra_src ${_packagechooser}/ItemAppStream.cpp)
endif()