Commit e665de2c authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen 🌈
Browse files

Unbreak build on older versions of Accounts-Qt5

There's little other new stuff in 1.16, and given this is non-vital
information, which also is not always available anyway (requiring
UIs to take this being empty into account anyway), we can deal with
not having this information for older versions of the dependency.
parent 0fdb43ac
......@@ -41,6 +41,12 @@ ecm_generate_headers(kaccountslib_HEADERS
add_library(kaccounts ${kaccountslib_SRCS})
target_compile_definitions(kaccounts
PRIVATE
ACCOUNTSQT5_VERSION_MAJOR=${AccountsQt5_VERSION_MAJOR}
ACCOUNTSQT5_VERSION_MINOR=${AccountsQt5_VERSION_MINOR}
)
generate_export_header(kaccounts BASE_NAME kaccounts)
target_link_libraries (kaccounts
PUBLIC
......
......@@ -92,7 +92,11 @@ QVariant ServicesModel::data(const QModelIndex& index, int role) const
data.setValue(service.name());
break;
case DescriptionRole:
#if ACCOUNTSQT5_VERSION_MAJOR==1 && ACCOUNTSQT5_VERSION_MINOR>=16
// Not all services have descriptions and UIs should be designed with that in mind.
// Consequently, we can accept not having a fallback for this.
data.setValue(service.description());
#endif
break;
case DisplayNameRole:
data.setValue(service.displayName());
......
Markdown is supported
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