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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • akonadi
kdsignalblocker.cpp
1 /****************************************************************************
2 ** Copyright (C) 2001-2012 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Tools library.
5 **
6 ** Licensees holding valid commercial KD Tools licenses may use this file in
7 ** accordance with the KD Tools Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the GNU
12 ** Lesser General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.net if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #include "kdsignalblocker.h"
24 
25 #include <QObject>
26 
27 using namespace Akonadi;
28 
43 KDSignalBlocker::KDSignalBlocker( QObject * o )
44  : wasBlocked( o->signalsBlocked() ), object( o )
45 {
46  o->blockSignals( true );
47 }
48 
54 KDSignalBlocker::KDSignalBlocker( QObject & o )
55  : wasBlocked( o.signalsBlocked() ), object( &o )
56 {
57  o.blockSignals( true );
58 }
59 
66 KDSignalBlocker::~KDSignalBlocker()
67 {
68  unblock();
69 }
70 
71 /*
72  Unblocks signals (unless they were blocked before).
73  You can use reblock() to block them again.
74  There is no need to reblock before destruction.
75 
76  \post o->signalsBlocked() is the same as just before this instance has been constructed.
77 */
78 void KDSignalBlocker::unblock()
79 {
80  object->blockSignals( wasBlocked );
81 }
82 
83 /*
84  Unblocks signals (unless they were blocked before)
85  \post o->signalsBlocked() is the same as just before this instance has been constructed.
86 */
87 void KDSignalBlocker::reblock()
88 {
89  object->blockSignals( true );
90 }
91 
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

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