diff options
author | Björn Hagemeister | 2014-05-26 18:34:36 +0200 |
---|---|---|
committer | Björn Hagemeister | 2014-05-26 18:34:36 +0200 |
commit | 494727e1e5f0e459153e8845168545ad4a72e598 (patch) | |
tree | 1d0328d6b7ea8d53aec693fa06681379cb20b998 /src/client/main.cpp | |
parent | Merge branch 'master' of git.openslx.org:pvs2 (diff) | |
download | pvs2-494727e1e5f0e459153e8845168545ad4a72e598.tar.gz pvs2-494727e1e5f0e459153e8845168545ad4a72e598.tar.xz pvs2-494727e1e5f0e459153e8845168545ad4a72e598.zip |
Several changes:
Fixed segmentaion fault, which occured after streaming to all clients.
Added sessionName as command line argument to client, so that it connects immediatly after running to given sessionName.
If pvsclient shows connected status also display IP-Adress of the running pvsmanager.
Diffstat (limited to 'src/client/main.cpp')
-rw-r--r-- | src/client/main.cpp | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/src/client/main.cpp b/src/client/main.cpp index cea9ae8..ebc6375 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -3,39 +3,46 @@ int main(int argc, char** argv) { - QApplication app(argc, argv); - app.setOrganizationName("openslx"); - app.setOrganizationDomain("openslx.org"); - app.setApplicationName("pvsclient"); + QByteArray sessionName; + if (argc != 2) + { + sessionName = ""; + } + else + sessionName = argv[1]; + QApplication app(argc, argv); + app.setOrganizationName("openslx"); + app.setOrganizationDomain("openslx.org"); + app.setApplicationName("pvsclient"); - qsrand((uint)QDateTime::currentMSecsSinceEpoch()); + qsrand((uint)QDateTime::currentMSecsSinceEpoch()); - // Make sure settings directory exists - do { - USER_SETTINGS(settings); - QFileInfo fi(settings.fileName()); - QDir path(fi.path()); - qDebug() << "Settings directory is " << fi.path(); - if (!path.exists()) - path.mkpath(path.absolutePath()); - // Now check if settings file exists. If not, copy system default (if available) - if (!fi.exists()) + // Make sure settings directory exists + do { + USER_SETTINGS(settings); + QFileInfo fi(settings.fileName()); + QDir path(fi.path()); + qDebug() << "Settings directory is " << fi.path(); + if (!path.exists()) + path.mkpath(path.absolutePath()); + // Now check if settings file exists. If not, copy system default (if available) + if (!fi.exists()) + { + SYSTEM_SETTINGS(sys); + QFileInfo sysfi(sys.fileName()); + if (sysfi.exists()) { - SYSTEM_SETTINGS(sys); - QFileInfo sysfi(sys.fileName()); - if (sysfi.exists()) - { - if (!QFile::copy(sys.fileName(), settings.fileName())) - qDebug() << "Copying default settings from " << sys.fileName() << " to " << settings.fileName() << " failed."; - } + if (!QFile::copy(sys.fileName(), settings.fileName())) + qDebug() << "Copying default settings from " << sys.fileName() << " to " << settings.fileName() << " failed."; } - } while (0); + } + } while (0); - // use system locale as language to translate gui - QTranslator translator; - translator.load(":pvsclient"); - app.installTranslator(&translator); + // use system locale as language to translate gui + QTranslator translator; + translator.load(":pvsclient"); + app.installTranslator(&translator); - Toolbar pvsclient; - return app.exec(); + Toolbar pvsclient(sessionName); + return app.exec(); } |