~ubuntu-branches/ubuntu/karmic/digikam/karmic

« back to all changes in this revision

Viewing changes to utilities/imageeditor/tools/signalblocker.h

  • Committer: Bazaar Package Importer
  • Author(s): Luka Renko
  • Date: 2009-02-14 17:52:28 UTC
  • mfrom: (1.2.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20090214175228-axs6z8e5pgg7bqfx
Tags: 2:0.10.0~rc2-0ubuntu1
* New upstream release (release candidate 2)
* patches/01-kubuntu-fix-armel.patch: 
  - Dropped, included upstream
* control: 
  - Remove quilt from build-depends (no patches)
  - Add liblensfun-dev to build-depends (now in main)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2009-02-06
 
7
 * Description : image editor printing interface.
 
8
 *               inspired from  Gwenview code (Aurélien Gâteau).
 
9
 *
 
10
 * Copyright (C) 2009 by Angelo Naselli <anaselli at linux dot it>
 
11
 *
 
12
 * This program is free software; you can redistribute it
 
13
 * and/or modify it under the terms of the GNU General
 
14
 * Public License as published by the Free Software Foundation;
 
15
 * either version 2, or (at your option)
 
16
 * any later version.
 
17
 *
 
18
 * This program is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * ============================================================ */
 
24
 
 
25
#ifndef SIGNALBLOCKER_H
 
26
#define SIGNALBLOCKER_H
 
27
 
 
28
// Qt includes.
 
29
 
 
30
#include <QObject>
 
31
 
 
32
namespace Digikam
 
33
{
 
34
 
 
35
  /**
 
36
   * An RAII class to block and unblock signals from a QObject instance
 
37
   */
 
38
  class SignalBlocker
 
39
  {
 
40
    public:
 
41
      SignalBlocker ( QObject* object )
 
42
      {
 
43
        mObject = object;
 
44
        mWasBlocked = object->blockSignals ( true );
 
45
      }
 
46
 
 
47
      ~SignalBlocker()
 
48
      {
 
49
        mObject->blockSignals ( mWasBlocked );
 
50
      }
 
51
 
 
52
    private:
 
53
      QObject* mObject;
 
54
      bool mWasBlocked;
 
55
  };
 
56
 
 
57
} // namespace
 
58
 
 
59
#endif /* SIGNALBLOCKER_H */