From 3464aa7e56f900ab37772e7c1bb4dade1ae7d7a9 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 29 Jul 2014 16:00:03 +0200 Subject: Fixed, deleting clients after SessionNameUpdate. Using Counter, change for the first time --> do nothing change for the second time --> delete clients. Maybe too complicated for user? --- TODO | 10 ++++++++-- src/server/mainwindow/mainwindow.cpp | 16 +++++++++++----- src/server/mainwindow/mainwindow.h | 1 + 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index 22a982f..d3518cf 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,12 @@ ----------------------------------- B U G S ------------------------------------- [x] Frame auf 0,0 gemoved will gelöscht werden. sollte nicht sein. - +[ ] Bei setzen des Session Name werden wieder alle Frames geschmissen, d.h. + die Raumbelegungsaufteilung ist hinüber. + [ ]--> Lösung: Clienten und Frames nicht löschen bei SessionName + aktualisierung --> sinnvoll? oder zu allgemein? + [x]--> Möglichkeit mit Counter: bei erster Änderung --> nicht löschen + bei weiteren Änderungen --> löschen + --> zu kompliziert für Nutzer? --------------------------- P V S M G R ---------------------------------------- @@ -63,7 +69,7 @@ anmelden, in der Zwischenzeit kann das System auf den default resetten....> --------------------------- P V S C L I E N T ---------------------------------- -[funktioniert bei mir] +[funktioniert bei mir(manuel), bei mir(bjoern) auch] Beim Client: Wenn Session-ID im laufenden betrieb geändert wird, fliegt der Client raus. Man kann als Client (dann) keine neue Session-ID setzen. diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 82981b1..71ee8a6 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -129,7 +129,9 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) : _discoveryListener = new DiscoveryListener(); // Finally -// this->onSessionNameUpdate(); + _countSessionNameUpdate = 0; + this->onSessionNameUpdate(); // Just make lable visible. + _countSessionNameUpdate = 0; _tileWidth = ui->frmRoom->size().width() / _tilesX; _tileHeight = ui->frmRoom->size().height() / _tilesY; @@ -622,14 +624,18 @@ void MainWindow::onSessionNameClick() */ void MainWindow::onSessionNameUpdate() { + _countSessionNameUpdate++; // Stop all projections and clear all clients, which where connected to old sessionName. reset(); - for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + if (_countSessionNameUpdate > 1) { - (*it)->hide(); - (*it)->deleteLater(); + for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + { + (*it)->hide(); + (*it)->deleteLater(); + } + _clientFrames.clear(); } - _clientFrames.clear(); _sessionNameLabel->setText(tr("Session Name: %1 [click to edit]").arg(Global::sessionName())); } diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index 1990fe6..924738c 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -56,6 +56,7 @@ private: None } _mode; int _streamingSource; + int _countSessionNameUpdate; QList _clientFrames; ListenServer *_listenServer; -- cgit v1.2.3-55-g7522