diff options
-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_ */ |