Refactor SignalProxy, network and protocol code
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 17 Jan 2013 22:31:34 +0000 (23:31 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 17 Jan 2013 23:00:50 +0000 (00:00 +0100)
commit0e1b154f362e13c2c9009f842e3fd6d8e7c346fc
tree9b475f997cc674a9f7c897c12943832c81af4b2d
parentc9e3e41c9446e58073225db379d28e1a08e15cd8
Refactor SignalProxy, network and protocol code

Until now, SignalProxy also contained the protocol implementation and
handled the network data transfer. Besides being an architectural nightmare,
this also made it impossible to work on a new protocol.

As a nice sideeffect, the code size of SignalProxy shrunk by more than 30%.

This commit does the following:

* Provide a common abstraction for internal (mono) and remote connections,
  so we can remove the special casing for mono clients in the SignalProxy.
  This should also make it easier to bring back remote capabilities to the mono
  client in the future.

* Move the networking code into RemoteConnection, which also acts as an abstraction
  layer for the current and future core/client protocols.

* Move the protocol-specific code into LegacyConnection.

* Introduce explicit protocol message types (as opposed to QVariantMaps). This gives
  us type safety and allows for a cleaner and more efficient handling inside SignalProxy.
  Also, I finally got to use templates \o/

Note that the handshake/auth code still needs to be abstracted, so for now the
LegacyConnection is still used directly in (the awkwardly mis-named) CoreConnection
and Core for reading/writing their data during the init phase.
18 files changed:
src/client/coreconnection.cpp
src/client/coreconnection.h
src/common/CMakeLists.txt
src/common/internalconnection.cpp [new file with mode: 0644]
src/common/internalconnection.h [new file with mode: 0644]
src/common/protocols/legacy/legacyconnection.cpp [new file with mode: 0644]
src/common/protocols/legacy/legacyconnection.h [new file with mode: 0644]
src/common/remoteconnection.cpp [new file with mode: 0644]
src/common/remoteconnection.h [new file with mode: 0644]
src/common/signalproxy.cpp
src/common/signalproxy.h
src/core/core.cpp
src/core/core.h
src/core/coresession.cpp
src/core/coresession.h
src/core/sessionthread.cpp
src/core/sessionthread.h
src/qtui/monoapplication.cpp