History

Get Interface to look in the proper directories

Zach Fox committed 7 years ago

Commit 1e24df31 parent 82c75e98 files · +380 −353Browse files

Showing the changes to interface/src/scripting/ScreenshareScriptingInterface.cpp (1 of 8 files). Show all

Unified · Split

interface/src/scripting/ScreenshareScriptingInterface.cpp+9−4
@@ -21,7 +21,7 @@ ScreenshareScriptingInterface::ScreenshareScriptingInterface() { · 20 unmodified lines
2121
2222 };
2323
24−void ScreenshareScriptingInterface::startScreenshare(QString displayName, QString userName, QString token, QString sessionID, QString apiKey, QString fileLocation) {
24+void ScreenshareScriptingInterface::startScreenshare(QString displayName, QString userName, QString token, QString sessionID, QString apiKey) {
2525 if (QThread::currentThread() != thread()) {
2626 // We must start a new QProcess from the main thread.
2727 QMetaObject::invokeMethod(
@@ -30,14 +30,19 @@ void ScreenshareScriptingInterface::startScreenshare(QString displayName, QStrin · 2 unmodified lines
3030 Q_ARG(QString, userName),
3131 Q_ARG(QString, token),
3232 Q_ARG(QString, sessionID),
33− Q_ARG(QString, apiKey),
34− Q_ARG(QString, fileLocation)
33+ Q_ARG(QString, apiKey)
3534 );
3635 return;
3736 }
3837
3938 qDebug() << "ZRF: Inside startScreenshare(). `SCREENSHARE_EXE_PATH`:" << SCREENSHARE_EXE_PATH;
4039
40+ QFileInfo screenshareExecutable(SCREENSHARE_EXE_PATH);
41+ if (!screenshareExecutable.exists() || !screenshareExecutable.isFile()) {
42+ qDebug() << "Screenshare executable doesn't exist at" << SCREENSHARE_EXE_PATH;
43+ return;
44+ }
45+
4146 if (displayName.isEmpty() || userName.isEmpty() || token.isEmpty() || sessionID.isEmpty() || apiKey.isEmpty()) {
4247 qDebug() << "Screenshare executable can't launch without connection info.";
4348 return;
@@ -65,6 +70,6 @@ void ScreenshareScriptingInterface::startScreenshare(QString displayName, QStrin · 21 unmodified lines
6570 // Note for Milad:
6671 // We'll have to have equivalent lines of code for MacOS.
6772 #ifdef Q_OS_WIN
68− electronProcess->start(fileLocation, arguments);
73+ electronProcess->start(SCREENSHARE_EXE_PATH, arguments);
6974 #endif
7075 };