MailTransport

transportconfigwidget.cpp
1 /*
2  Copyright (c) 2009 Constantin Berzan <[email protected]>
3 
4  Based on MailTransport code by:
5  Copyright (c) 2006 - 2007 Volker Krause <[email protected]>
6  Copyright (c) 2007 KovoKs <[email protected]>
7 
8  Based on KMail code by:
9  Copyright (c) 2001-2002 Michael Haeckel <[email protected]>
10 
11  This library is free software; you can redistribute it and/or modify it
12  under the terms of the GNU Library General Public License as published by
13  the Free Software Foundation; either version 2 of the License, or (at your
14  option) any later version.
15 
16  This library is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
19  License for more details.
20 
21  You should have received a copy of the GNU Library General Public License
22  along with this library; see the file COPYING.LIB. If not, write to the
23  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24  02110-1301, USA.
25 */
26 
27 #include "transportconfigwidget.h"
28 #include "transportconfigwidget_p.h"
29 #include "transport.h"
30 #include "transportmanager.h"
31 
32 #include <KConfigDialogManager>
33 #include "mailtransport_debug.h"
34 
35 using namespace MailTransport;
36 
38  : QWidget(parent)
39  , d_ptr(new TransportConfigWidgetPrivate)
40 {
41  init(transport);
42 }
43 
44 TransportConfigWidget::TransportConfigWidget(TransportConfigWidgetPrivate &dd, Transport *transport, QWidget *parent)
45  : QWidget(parent)
46  , d_ptr(&dd)
47 {
48  init(transport);
49 }
50 
52 {
53  delete d_ptr;
54 }
55 
56 void TransportConfigWidget::init(Transport *transport)
57 {
59  qCDebug(MAILTRANSPORT_LOG) << "this" << this << "d" << d;
60  Q_ASSERT(transport);
61  d->transport = transport;
62 
63  d->manager = new KConfigDialogManager(this, transport);
64 }
65 
67 {
68  Q_D(const TransportConfigWidget);
69  Q_ASSERT(d->manager);
70  return d->manager;
71 }
72 
74 {
76  d->manager->updateSettings();
77  d->transport->forceUniqueName();
78  d->transport->save();
79  qCDebug(MAILTRANSPORT_LOG) << "Config written.";
80 }
KConfigDialogManager * configManager() const
virtual void apply()
Saves the transport&#39;s settings.
~TransportConfigWidget() override
Destroys the widget.
QWidget(QWidget *parent, Qt::WindowFlags f)
QObject * parent() const const
Represents the settings of a specific mail transport.
Definition: transport.h:40
TransportConfigWidget(Transport *transport, QWidget *parent=nullptr)
Creates a new mail transport configuration widget for the given Transport object. ...
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 1 2020 23:10:04 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.