-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(RemoteConnection*)), _session, SLOT(addClient(RemoteConnection*)));
+ connect(this, SIGNAL(addInternalClient(InternalConnection*)), _session, SLOT(addClient(InternalConnection*)));
+ connect(_session, SIGNAL(sessionState(QVariant)), Core::instance(), SIGNAL(sessionState(QVariant)));
+ emit initialized();
+ exec();
+ delete _session;