File: mergededicateddialog.cpp

package info (click to toggle)
kpeople 5.116.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 832 kB
  • sloc: cpp: 3,723; xml: 10; makefile: 7; sh: 2
file content (36 lines) | stat: -rw-r--r-- 1,047 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
    SPDX-FileCopyrightText: 2013 Franck Arrecot <franck.arrecot@gmail.com>

    SPDX-License-Identifier: LGPL-2.1-or-later
*/

#include <QApplication>

#include <personsmodel.h>
#include <personsmodelfeature.h>
#include <widgets/mergedialog.h>

using namespace KPeople;

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    MergeDialog dialog;
    PersonsModel *persons = new PersonsModel(&dialog);
    QList<KPeople::PersonsModelFeature> features;
    /* clang-format off */
    features << KPeople::PersonsModelFeature::emailModelFeature()
             << KPeople::PersonsModelFeature::avatarModelFeature()
             << KPeople::PersonsModelFeature::imModelFeature()
             << KPeople::PersonsModelFeature::fullNameModelFeature();
    /* clang-format on */
    persons->startQuery(features);

    dialog.setPersonsModel(persons);

    QObject::connect(persons, SIGNAL(modelInitialized()), &dialog, SLOT(show()));
    QObject::connect(&dialog, SIGNAL(finished(int)), &app, SLOT(quit()));

    return app.exec();
}