summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-07-29 16:00:03 +0200
committerBjörn Hagemeister2014-07-29 16:00:03 +0200
commit3464aa7e56f900ab37772e7c1bb4dade1ae7d7a9 (patch)
tree6e8917eca4f3d028f810cbbe32af94e3092ec8df /src/server/mainwindow/mainwindow.cpp
parentFixed bug, that frame moved on (0,0) is asked to be deleted. (diff)
downloadpvs2-3464aa7e56f900ab37772e7c1bb4dade1ae7d7a9.tar.gz
pvs2-3464aa7e56f900ab37772e7c1bb4dade1ae7d7a9.tar.xz
pvs2-3464aa7e56f900ab37772e7c1bb4dade1ae7d7a9.zip
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?
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp16
1 files changed, 11 insertions, 5 deletions
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<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
+ if (_countSessionNameUpdate > 1)
{
- (*it)->hide();
- (*it)->deleteLater();
+ for (QList<ConnectionFrame*>::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()));
}