Commit 961df98e authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Don't use ::commonIds if snap is too old

parent d7025644
......@@ -3,6 +3,10 @@ add_subdirectory(libsnapclient)
add_library(snap-backend MODULE SnapResource.cpp SnapBackend.cpp SnapReviewsBackend.cpp SnapTransaction.cpp snapui.qrc)
target_link_libraries(snap-backend Qt5::Core KF5::CoreAddons KF5::ConfigCore Discover::Common Snapd::Core)
if ("${Snapd_VERSION}" VERSION_GREATER 1.40)
target_compile_definitions(snap-backend PRIVATE -DSNAP_COMMON_IDS)
install(TARGETS snap-backend DESTINATION ${PLUGIN_INSTALL_DIR}/discover)
install(FILES snap-backend-categories.xml DESTINATION ${DATA_INSTALL_DIR}/libdiscover/categories)
......@@ -323,6 +323,10 @@ QAbstractItemModel* SnapResource::plugs(QObject* p)
QString SnapResource::appstreamId() const
const auto ids = m_snap->commonIds();
const QStringList ids
#if defined(SNAP_COMMON_IDS)
= m_snap->commonIds()
return ids.isEmpty() ? QLatin1String("com.snap.") + m_snap->name() : ids.first();
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