Back to index

scribus-ng  1.3.4.dfsg+svn20071115
stylecontext.cpp
Go to the documentation of this file.
00001 /*
00002  For general Scribus (>=1.3.2) copyright and licensing information please refer
00003  to the COPYING file provided with the program. Following this notice may exist
00004  a copyright and/or license notice that predates the release of Scribus 1.3.2
00005  for which a new license (GPL+exception) is in place.
00006  */
00007 /***************************************************************************
00008 *                                                                         *
00009 *   This program is free software; you can redistribute it and/or modify  *
00010 *   it under the terms of the GNU General Public License as published by  *
00011 *   the Free Software Foundation; either version 2 of the License, or     *
00012 *   (at your option) any later version.                                   *
00013 *                                                                         *
00014 ***************************************************************************/
00015 
00016 
00017 #include "stylecontext.h"
00018 
00019 void StyleContext::invalidate()
00020 {
00021        ++m_version; 
00022        if (m_sig && m_cnt > 0)          // activate() can be slow even if there's nothing to signal
00023               m_sig->activate(); 
00024 }
00025 
00026 bool StyleContext::connect(const QObject* receiver, const char *member ) const
00027 {
00028        if (!m_sig)
00029               m_sig = new QSignal();
00030        bool result = m_sig->connect(receiver, member);
00031        if (result)
00032               ++m_cnt;
00033        return result;
00034 }
00035 
00036 bool StyleContext::disconnect(const QObject* receiver, const char *member ) const
00037 {
00038        if (!m_sig)
00039               return false;
00040        
00041        bool result = m_sig->disconnect(receiver, member);
00042        if (result)
00043               --m_cnt;
00044        return result;
00045 }
00046