• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kontact

  • sources
  • kde-4.14
  • kdepim
  • kontact
  • src
kontactconfiguredialog.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KMail, the KDE mail client.
3  Copyright (c) 2012-2015 Montel Laurent <montel@kde.org>
4 
5  KMail is free software; you can redistribute it and/or modify it
6  under the terms of the GNU General Public License, version 2, as
7  published by the Free Software Foundation.
8 
9  KMail is distributed in the hope that it will be useful, but
10  WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 #include "kontactconfiguredialog.h"
19 
20 #include <KDebug>
21 
22 #include <QDBusReply>
23 #include <QDBusInterface>
24 
25 using namespace Kontact;
26 
27 KontactConfigureDialog::KontactConfigureDialog( QWidget *parent )
28  : KSettings::Dialog( parent )
29 {
30  connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
31  connect( this, SIGNAL(applyClicked()), SLOT(slotApply()) );
32 }
33 
34 KontactConfigureDialog::~KontactConfigureDialog()
35 {
36 }
37 
38 void KontactConfigureDialog::emitConfigChanged()
39 {
40  //Add code from plugins which needs to be call when we close kontact dialog config
41  QDBusInterface kmailIface( QLatin1String("org.kde.kmail"), QLatin1String("/KMail"), QLatin1String("org.kde.kmail.kmail"),
42  QDBusConnection::sessionBus() );
43  if ( kmailIface.isValid() ) {
44  QDBusReply<void> reply;
45  if ( !( reply = kmailIface.call( QLatin1String("updateConfig") ) ).isValid() ) {
46  QDBusError err = kmailIface.lastError();
47  kError() << "Communication problem with KMail. "
48  << "Error message was:" << err.name() << ": \"" << err.message() << "\"";
49  }
50  }
51  QDBusInterface knotesIface( QLatin1String("org.kde.kontact"), QLatin1String("/KNotes"), QLatin1String("org.kde.kontact.KNotes"),
52  QDBusConnection::sessionBus() );
53  if ( knotesIface.isValid() ) {
54  QDBusReply<void> reply;
55  if ( !( reply = knotesIface.call( QLatin1String("updateConfig") ) ).isValid() ) {
56  const QDBusError err = knotesIface.lastError();
57  kError() << "Communication problem with KNotes. "
58  << "Error message was:" << err.name() << ": \"" << err.message() << "\"";
59  }
60 
61 
62  }
63 }
64 
65 void KontactConfigureDialog::slotApply()
66 {
67  slotApplyClicked();
68  emitConfigChanged();
69 }
70 
71 void KontactConfigureDialog::slotOk()
72 {
73  slotOkClicked();
74  emitConfigChanged();
75 }
76 
QWidget
QDBusAbstractInterface::isValid
bool isValid() const
QDBusReply
QDBusError::name
QString name() const
QDBusError::message
QString message() const
QDBusConnection::sessionBus
QDBusConnection sessionBus()
QDBusAbstractInterface::call
QDBusMessage call(const QString &method, const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8)
Kontact::KontactConfigureDialog::slotOk
void slotOk()
Definition: kontactconfiguredialog.cpp:71
kontactconfiguredialog.h
QDBusInterface
Kontact::KontactConfigureDialog::KontactConfigureDialog
KontactConfigureDialog(QWidget *parent=0)
Definition: kontactconfiguredialog.cpp:27
QLatin1String
Kontact::KontactConfigureDialog::slotApply
void slotApply()
Definition: kontactconfiguredialog.cpp:65
Kontact::KontactConfigureDialog::emitConfigChanged
void emitConfigChanged()
Definition: kontactconfiguredialog.cpp:38
Kontact::KontactConfigureDialog::~KontactConfigureDialog
~KontactConfigureDialog()
Definition: kontactconfiguredialog.cpp:34
QDBusAbstractInterface::lastError
QDBusError lastError() const
QDBusError
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kontact

Skip menu "kontact"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal