diff options
author | Björn Hagemeister | 2014-04-14 17:29:29 +0200 |
---|---|---|
committer | Björn Hagemeister | 2014-04-14 17:29:29 +0200 |
commit | f47835fb49fd059d898c1d74ab6e317c001e7e1e (patch) | |
tree | 3e96fc1ab38fd9391f6b82a359b91e58ed964e64 /src | |
parent | Fix inclusion of X11 lib for pvsclient (diff) | |
download | pvs2-f47835fb49fd059d898c1d74ab6e317c001e7e1e.tar.gz pvs2-f47835fb49fd059d898c1d74ab6e317c001e7e1e.tar.xz pvs2-f47835fb49fd059d898c1d74ab6e317c001e7e1e.zip |
Changed session name to be random at the beginning of each session.# Please enter the commit message for your changes. Lines starting
Diffstat (limited to 'src')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 2 | ||||
-rw-r--r-- | src/server/util/global.cpp | 7 | ||||
-rw-r--r-- | src/server/util/global.h | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 50f70cc..f4c1809 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -42,7 +42,7 @@ MainWindow::MainWindow(QWidget* parent) : _sessionNameWindow = new SessionNameWindow(this); ui->setupUi(this); - Global::setSessionName("1234"); + Global::setSessionName(); //conWin = new ConnectionWindow(ui->widget); //ui->VconWinLayout->addWidget(conWin); diff --git a/src/server/util/global.cpp b/src/server/util/global.cpp index 9b7b4f2..bd8cdd7 100644 --- a/src/server/util/global.cpp +++ b/src/server/util/global.cpp @@ -15,3 +15,10 @@ void Global::setSessionName(const QString& name) Global::_sessionName = name; Global::_sessionNameArray = name.toUtf8(); } + +void Global::setSessionName() +{ + const QString name = QString::number(qrand() % 9000 + 1000); + Global::_sessionName = name; + Global::_sessionNameArray = name.toUtf8(); +} diff --git a/src/server/util/global.h b/src/server/util/global.h index 38eec6d..c5e0728 100644 --- a/src/server/util/global.h +++ b/src/server/util/global.h @@ -24,6 +24,7 @@ public: static const QString& sessionName() { return Global::_sessionName; } static const QByteArray& sessionNameArray() { return Global::_sessionNameArray; } static void setSessionName(const QString& name); + static void setSessionName(); }; #endif /* GLOBAL_H_ */ |