Just added some safetychecks
authorMarcus Eggenberger <egs@quassel-irc.org>
Tue, 13 Nov 2007 16:53:15 +0000 (16:53 +0000)
committerMarcus Eggenberger <egs@quassel-irc.org>
Tue, 13 Nov 2007 16:53:15 +0000 (16:53 +0000)
src/common/networkinfo.cpp
src/common/signalproxy.cpp
src/common/signalproxy.h

index 8791fff..1a051f0 100644 (file)
@@ -169,7 +169,10 @@ IrcUser *NetworkInfo::newIrcUser(const QString &hostmask) {
     // mark IrcUser as already initialized to keep the SignalProxy from requesting initData
     if(initialized())
       ircuser->setInitialized();
     // mark IrcUser as already initialized to keep the SignalProxy from requesting initData
     if(initialized())
       ircuser->setInitialized();
-    _proxy->synchronize(ircuser);
+    if(proxy())
+      proxy()->synchronize(ircuser);
+    else
+      qWarning() << "unable to synchronize new IrcUser" << hostmask << "forgot to call NetworkInfo::setProxy(SignalProxy *)?";
     
     connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickChanged(QString)));
     connect(ircuser, SIGNAL(initDone()), this, SIGNAL(ircUserInitDone()));
     
     connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickChanged(QString)));
     connect(ircuser, SIGNAL(initDone()), this, SIGNAL(ircUserInitDone()));
@@ -197,7 +200,11 @@ IrcChannel *NetworkInfo::newIrcChannel(const QString &channelname) {
     // mark IrcUser as already initialized to keep the SignalProxy from requesting initData
     if(initialized())
       channel->setInitialized();
     // mark IrcUser as already initialized to keep the SignalProxy from requesting initData
     if(initialized())
       channel->setInitialized();
-    _proxy->synchronize(channel);
+
+    if(proxy())
+      proxy()->synchronize(channel);
+    else
+      qWarning() << "unable to synchronize new IrcChannel" << channelname << "forgot to call NetworkInfo::setProxy(SignalProxy *)?";
 
     connect(channel, SIGNAL(initDone()), this, SIGNAL(ircChannelInitDone()));
     connect(channel, SIGNAL(destroyed()), this, SLOT(channelDestroyed()));
 
     connect(channel, SIGNAL(initDone()), this, SIGNAL(ircChannelInitDone()));
     connect(channel, SIGNAL(destroyed()), this, SLOT(channelDestroyed()));
index b7ac968..904768d 100644 (file)
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************
- *   SignalProxy has been inspired by QxtRPCPeer, part of libqxt,          *
- *   the Qt eXTension Library <http://www.libqxt.org>. We would like to    *
- *   thank Arvid "aep" Picciani and Adam "ahigerd" Higerd for providing    *
- *   QxtRPCPeer, valuable input and the genius idea to (ab)use Qt's        *
- *   Meta Object System for transmitting signals over the network.         *
- *                                                                         *
- *   To make contribution back into libqxt possible, redistribution and    *
- *   modification of this file is additionally allowed under the terms of  *
- *   the Common Public License, version 1.0, as published by IBM.          *
  ***************************************************************************/
 
 #include "signalproxy.h"
  ***************************************************************************/
 
 #include "signalproxy.h"
index 5001060..4e59e80 100644 (file)
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************
- *   SignalProxy has been inspired by QxtRPCPeer, part of libqxt,          *
- *   the Qt eXTension Library <http://www.libqxt.org>. We would like to    *
- *   thank Arvid "aep" Picciani and Adam "ahigerd" Higerd for providing    *
- *   QxtRPCPeer, valuable input and the genius idea to (ab)use Qt's        *
- *   Meta Object System for transmitting signals over the network.         *
- *                                                                         *
- *   To make contribution back into libqxt possible, redistribution and    *
- *   modification of this file is additionally allowed under the terms of  *
- *   the Common Public License, version 1.0, as published by IBM.          *
  ***************************************************************************/
 
 #ifndef _SIGNALPROXY_H_
  ***************************************************************************/
 
 #ifndef _SIGNALPROXY_H_