Commit 34f0de27 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Add support for compilers lacking <ranges>

GnuPG-bug-id: 5843
parent afe35609
......@@ -71,7 +71,10 @@
#include <QVBoxLayout>
#include <map>
#if __has_include(<ranges>)
#include <ranges>
#define USE_RANGES
#endif
#include <set>
Q_DECLARE_METATYPE(GpgME::UserID)
......@@ -622,7 +625,13 @@ void CertificateDetailsWidget::Private::setUpSMIMEAdressList()
}
// iterate over the secondary user IDs
#ifdef USE_RANGES
for (const auto uids = key.userIDs(); const auto &uid : std::ranges::subrange(std::next(uids.begin()), uids.end())) {
#else
const auto uids = key.userIDs();
for (auto it = std::next(uids.begin()); it != uids.end(); ++it) {
const auto &uid = *it;
#endif
const auto name = Kleo::Formatting::prettyName(uid);
const auto email = Kleo::Formatting::prettyEMail(uid);
if (name.isEmpty() && !email.isEmpty()) {
......
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