File indexing completed on 2024-11-24 04:43:04

0001 /*
0002     SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <Akonadi/Item>
0010 #include <QObject>
0011 
0012 namespace KABMergeContacts
0013 {
0014 class SearchPotentialDuplicateContactJob : public QObject
0015 {
0016     Q_OBJECT
0017 public:
0018     explicit SearchPotentialDuplicateContactJob(const Akonadi::Item::List &list, QObject *parent = nullptr);
0019     ~SearchPotentialDuplicateContactJob() override;
0020 
0021     void start();
0022 
0023     [[nodiscard]] QList<Akonadi::Item::List> potentialDuplicateContacts() const;
0024 
0025 Q_SIGNALS:
0026     void finished(const QList<Akonadi::Item::List> &);
0027 
0028 private:
0029     [[nodiscard]] Akonadi::Item::List checkList(const Akonadi::Item::List &lstItem);
0030     [[nodiscard]] bool isDuplicate(const Akonadi::Item &itemA, const Akonadi::Item &itemB);
0031     const Akonadi::Item::List mListItem;
0032     QList<Akonadi::Item::List> mListDuplicate;
0033 };
0034 }