-void SessionThread::stopSession() {
- if(_session) {
- connect(_session, SIGNAL(destroyed()), this, SLOT(quit()));
- _session->deleteLater();
- _session = 0;
- }
+
+void SessionThread::run()
+{
+ _session = new CoreSession(user(), _restoreState);
+ connect(this, SIGNAL(addRemoteClient(RemotePeer*)), _session, SLOT(addClient(RemotePeer*)));
+ connect(this, SIGNAL(addInternalClient(InternalPeer*)), _session, SLOT(addClient(InternalPeer*)));
+ connect(_session, SIGNAL(sessionState(Protocol::SessionState)), Core::instance(), SIGNAL(sessionState(Protocol::SessionState)));
+ emit initialized();
+ exec();
+ delete _session;