KPeople

mergedialog.h
1 /*
2  KPeople - Duplicates
3  SPDX-FileCopyrightText: 2013 Franck Arrecot <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7 
8 #ifndef MERGEDIALOG_H
9 #define MERGEDIALOG_H
10 
11 #include <kpeople/widgets/kpeoplewidgets_export.h>
12 
13 #include <QDialog>
14 
15 class QStandardItem;
16 class KJob;
17 class MergeDialogPrivate;
18 
19 namespace KPeople
20 {
21 class PersonsModel;
22 class Match;
23 
24 /**
25  * The merge dialog will be used to provide a GUI to attempt to
26  * figure out what contacts should be merged.
27  *
28  * By properly mergeing contacts, the user will end up with having more
29  * information on each person.
30  *
31  * @since 5.8
32  */
33 class KPEOPLEWIDGETS_EXPORT MergeDialog : public QDialog
34 {
35  Q_OBJECT
36 
37 public:
38  enum Role {
39  NameRole = Qt::DisplayRole,
40  UriRole = Qt::UserRole + 1,
41  PixmapRole,
42  MergeReasonRole,
43  };
44 
45  explicit MergeDialog(QWidget *parent = nullptr);
46  ~MergeDialog() override;
47 
48  /**
49  * Specifies which PersonsModel will be used to look for duplicates.
50  */
51  void setPersonsModel(PersonsModel *model);
52 
53 private Q_SLOTS:
54  void searchForDuplicates();
55  void searchForDuplicatesFinished(KJob *);
56  void onMergeButtonClicked();
57 
58 private:
59  QStandardItem *itemMergeContactFromMatch(bool parent, const KPeople::Match &match);
60  void feedDuplicateModelFromMatches(const QList<Match> &matches);
61 
62  MergeDialogPrivate *const d_ptr;
63  Q_DECLARE_PRIVATE(MergeDialog)
64 };
65 
66 }
67 
68 #endif // MERGEDIALOG_H
DisplayRole
This class creates a model of all known contacts from all sources Contacts are represented as a tree ...
Definition: personsmodel.h:33
The merge dialog will be used to provide a GUI to attempt to figure out what contacts should be merge...
Definition: mergedialog.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jan 27 2022 22:42:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.