KPeople

mergedialog.h
1/*
2 KPeople - Duplicates
3 SPDX-FileCopyrightText: 2013 Franck Arrecot <franck.arrecot@gmail.com>
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
15class QStandardItem;
16class KJob;
17class MergeDialogPrivate;
18
19namespace KPeople
20{
21class PersonsModel;
22class 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 */
33class KPEOPLEWIDGETS_EXPORT MergeDialog : public QDialog
34{
35 Q_OBJECT
36
37public:
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
53private Q_SLOTS:
54 KPEOPLEWIDGETS_NO_EXPORT void searchForDuplicates();
55 KPEOPLEWIDGETS_NO_EXPORT void searchForDuplicatesFinished(KJob *);
56 KPEOPLEWIDGETS_NO_EXPORT void onMergeButtonClicked();
57
58private:
59 KPEOPLEWIDGETS_NO_EXPORT QStandardItem *itemMergeContactFromMatch(bool parent, const KPeople::Match &match);
60 KPEOPLEWIDGETS_NO_EXPORT 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
The merge dialog will be used to provide a GUI to attempt to figure out what contacts should be merge...
Definition mergedialog.h:34
This class creates a model of all known contacts from all sources Contacts are represented as a tree ...
DisplayRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.