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? --- src/server/mainwindow/mainwindow.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') 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())); } -- cgit v1.2.3-55-g7522