MailTransport

transportconfigwidget.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  Based on MailTransport code by:
5  SPDX-FileCopyrightText: 2006-2007 Volker Krause <[email protected]>
6  SPDX-FileCopyrightText: 2007 KovoKs <[email protected]>
7 
8  Based on KMail code by:
9  SPDX-FileCopyrightText: 2001-2002 Michael Haeckel <[email protected]>
10 
11  SPDX-License-Identifier: LGPL-2.0-or-later
12 */
13 
14 #include "transportconfigwidget.h"
15 #include "transport.h"
16 #include "transportconfigwidget_p.h"
17 
18 #include "mailtransport_debug.h"
19 #include <KConfigDialogManager>
20 
21 using namespace MailTransport;
22 
24  : QWidget(parent)
25  , d_ptr(new TransportConfigWidgetPrivate)
26 {
27  init(transport);
28 }
29 
30 TransportConfigWidget::TransportConfigWidget(TransportConfigWidgetPrivate &dd, Transport *transport, QWidget *parent)
31  : QWidget(parent)
32  , d_ptr(&dd)
33 {
34  init(transport);
35 }
36 
38 
39 void TransportConfigWidget::init(Transport *transport)
40 {
42  qCDebug(MAILTRANSPORT_LOG) << "this" << this << "d" << d;
43  Q_ASSERT(transport);
44  d->transport = transport;
45 
46  d->manager = new KConfigDialogManager(this, transport);
47 }
48 
50 {
52  Q_ASSERT(d->manager);
53  return d->manager;
54 }
55 
57 {
59  d->manager->updateSettings();
60  d->transport->forceUniqueName();
61  d->transport->save();
62  qCDebug(MAILTRANSPORT_LOG) << "Config written.";
63 }
~TransportConfigWidget() override
Destroys the widget.
TransportConfigWidget(Transport *transport, QWidget *parent=nullptr)
Creates a new mail transport configuration widget for the given Transport object.
KConfigDialogManager * configManager() const
Represents the settings of a specific mail transport.
Definition: transport.h:32
virtual void apply()
Saves the transport's settings.
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 03:57:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.