confirmbeforedeletingplugin.cpp 1.1 KB
Newer Older
1
2
3
4
5
6
7
8
/*
   SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>

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

#include "confirmbeforedeletingplugin.h"
#include "confirmbeforedeletingdialog.h"
Laurent Montel's avatar
Laurent Montel committed
9
#include "confirmbeforedeletinginterface.h"
Laurent Montel's avatar
Laurent Montel committed
10
#include <KPluginFactory>
11

Laurent Montel's avatar
Laurent Montel committed
12
13
14
K_PLUGIN_CLASS_WITH_JSON(ConfirmBeforeDeletingPlugin, "kmail_confirmbeforedeletingplugin.json")

ConfirmBeforeDeletingPlugin::ConfirmBeforeDeletingPlugin(QObject *parent, const QList<QVariant> &)
15
16
17
18
19
20
21
22
23
24
    : MessageViewer::MessageViewerCheckBeforeDeletingPlugin(parent)
{
}

ConfirmBeforeDeletingPlugin::~ConfirmBeforeDeletingPlugin()
{
}

void ConfirmBeforeDeletingPlugin::showConfigureDialog(QWidget *parent)
{
Laurent Montel's avatar
Laurent Montel committed
25
26
    ConfirmBeforeDeletingDialog dlg(parent);
    dlg.exec();
27
}
Laurent Montel's avatar
Laurent Montel committed
28

Laurent Montel's avatar
Laurent Montel committed
29
30
MessageViewer::MessageViewerCheckBeforeDeletingInterface *ConfirmBeforeDeletingPlugin::createInterface(QObject *parent)
{
Laurent Montel's avatar
Laurent Montel committed
31
32
    auto interface = new ConfirmBeforeDeletingInterface(parent);
    connect(interface, &ConfirmBeforeDeletingInterface::configure, this, &ConfirmBeforeDeletingPlugin::showConfigureDialog);
Laurent Montel's avatar
Laurent Montel committed
33
    return interface;
Laurent Montel's avatar
Laurent Montel committed
34
35
}

Laurent Montel's avatar
Laurent Montel committed
36
#include "confirmbeforedeletingplugin.moc"