Commit c009ce4d authored by Ahmad Samir's avatar Ahmad Samir Committed by Ingo Klöcker
Browse files

std::unary/binary_function have been deprecated and removed in C++17

GCC 12 now shows deprecation warnings for those. See:
https://gcc.gnu.org/gcc-12/porting_to.html#header-dep-changes
parent a175eb80
Pipeline #179751 passed with stage
in 2 minutes and 16 seconds
......@@ -31,7 +31,7 @@ static const QRegularExpression::PatternOption s_regex_cs = QRegularExpression::
std::vector<QRegularExpression> get_patterns(const std::vector<std::shared_ptr<Kleo::ChecksumDefinition>> &checksumDefinitions);
struct matches_any : std::unary_function<QString, bool> {
struct matches_any {
const std::vector<QRegularExpression> m_regexps;
explicit matches_any(const std::vector<QRegularExpression> &regexps) : m_regexps(regexps) {}
bool operator()(const QString &s) const
......
......@@ -399,7 +399,7 @@ static std::vector<Dir> find_dirs_by_sum_files(const QStringList &files, bool al
namespace
{
struct less_dir : std::binary_function<QDir, QDir, bool> {
struct less_dir {
bool operator()(const QDir &lhs, const QDir &rhs) const
{
return QString::compare(lhs.absolutePath(), rhs.absolutePath(), ChecksumsUtils::fs_cs) < 0;
......
......@@ -227,7 +227,7 @@ void DecryptVerifyFilesController::Private::ensureWizardCreated()
namespace
{
struct FindExtension : std::unary_function<std::shared_ptr<ArchiveDefinition>, bool> {
struct FindExtension {
const QString ext;
const Protocol proto;
FindExtension(const QString &ext, Protocol proto) : ext(ext), proto(proto) {}
......
......@@ -74,7 +74,7 @@ static QStringList fs_intersect(QStringList l1, QStringList l2)
#endif
namespace {
struct matches_none_of : std::unary_function<QString, bool> {
struct matches_none_of {
const std::vector<QRegularExpression> m_regexps;
explicit matches_none_of(const std::vector<QRegularExpression> &regexps) : m_regexps(regexps) {}
bool operator()(const QString &s) const
......@@ -237,19 +237,19 @@ static quint64 aggregate_size(const QDir &dir, const QStringList &files)
namespace
{
struct less_dir : std::binary_function<QDir, QDir, bool> {
struct less_dir {
bool operator()(const QDir &lhs, const QDir &rhs) const
{
return QString::compare(lhs.absolutePath(), rhs.absolutePath(), ChecksumsUtils::fs_cs) < 0;
}
};
struct less_file : std::binary_function<QString, QString, bool> {
struct less_file {
bool operator()(const QString &lhs, const QString &rhs) const
{
return QString::compare(lhs, rhs, ChecksumsUtils::fs_cs) < 0;
}
};
struct sumfile_contains_file : std::unary_function<QString, bool> {
struct sumfile_contains_file {
const QDir dir;
const QString fileName;
sumfile_contains_file(const QDir &dir_, const QString &fileName_)
......@@ -272,7 +272,6 @@ struct sumfile_contains_file : std::unary_function<QString, bool> {
return false;
}
};
}
// IF is_dir(file)
......
......@@ -120,13 +120,12 @@ int DecryptVerifyCommandFilesBase::doStart()
namespace
{
struct is_file : std::unary_function<QString, bool> {
struct is_file {
bool operator()(const QString &file) const
{
return QFileInfo(file).isFile();
}
};
}
void DecryptVerifyCommandFilesBase::Private::checkForErrors() const
......
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