NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceView, RunModus runModus, const QString &pathToQt) : NodeInstanceServerInterface(nodeInstanceView), m_localServer(new QLocalServer(this)), m_nodeInstanceView(nodeInstanceView), m_firstBlockSize(0), m_secondBlockSize(0), m_thirdBlockSize(0), m_writeCommandCounter(0), m_firstLastReadCommandCounter(0), m_secondLastReadCommandCounter(0), m_thirdLastReadCommandCounter(0), m_runModus(runModus), m_synchronizeId(-1) { QString socketToken(QUuid::createUuid().toString()); m_localServer->listen(socketToken); m_localServer->setMaxPendingConnections(3); QString applicationPath = pathToQt + QLatin1String("/bin"); if (runModus == TestModus) { applicationPath = QCoreApplication::applicationDirPath() + qmlPuppetApplicationDirectoryForTests() + qmlPuppetApplicationName(); } else { applicationPath = macOSBundlePath(applicationPath); applicationPath += QLatin1Char('/') + qmlPuppetApplicationName(); #if defined(QT_NO_DEBUG) || defined(SEARCH_PUPPET_IN_CREATOR_BINPATH) // to prevent of choosing the wrong puppet in debug if (!QFileInfo(applicationPath).exists()) { //No qmlpuppet in Qt //We have to find out how to give not too intrusive feedback applicationPath = creatorQmlPuppetPath(); } #endif } QByteArray envImportPath = qgetenv("QTCREATOR_QMLPUPPET_PATH"); if (!envImportPath.isEmpty()) applicationPath = envImportPath; QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) && (defined(Q_OS_MAC) || defined(Q_OS_LINUX)) environment.insert(QLatin1String("DESIGNER_DONT_USE_SHARED_MEMORY"), QLatin1String("1")); #endif if (QFileInfo(applicationPath).exists()) { m_qmlPuppetEditorProcess = new QProcess; m_qmlPuppetEditorProcess->setProcessEnvironment(environment); m_qmlPuppetEditorProcess->setObjectName("EditorProcess"); connect(m_qmlPuppetEditorProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus))); connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetEditorProcess.data(), SLOT(kill())); bool fowardQmlpuppetOutput = !qgetenv("FORWARD_QMLPUPPET_OUTPUT").isEmpty(); if (fowardQmlpuppetOutput) { m_qmlPuppetEditorProcess->setProcessChannelMode(QProcess::MergedChannels); connect(m_qmlPuppetEditorProcess.data(), SIGNAL(readyRead()), this, SLOT(printEditorProcessOutput())); } m_qmlPuppetEditorProcess->start(applicationPath, QStringList() << socketToken << "editormode" << "-graphicssystem raster"); if (runModus == NormalModus) { m_qmlPuppetPreviewProcess = new QProcess; m_qmlPuppetPreviewProcess->setProcessEnvironment(environment); m_qmlPuppetPreviewProcess->setObjectName("PreviewProcess"); connect(m_qmlPuppetPreviewProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus))); connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetPreviewProcess.data(), SLOT(kill())); if (fowardQmlpuppetOutput) { m_qmlPuppetPreviewProcess->setProcessChannelMode(QProcess::MergedChannels); connect(m_qmlPuppetPreviewProcess.data(), SIGNAL(readyRead()), this, SLOT(printPreviewProcessOutput())); } m_qmlPuppetPreviewProcess->start(applicationPath, QStringList() << socketToken << "previewmode" << "-graphicssystem raster"); m_qmlPuppetRenderProcess = new QProcess; m_qmlPuppetRenderProcess->setProcessEnvironment(environment); m_qmlPuppetRenderProcess->setObjectName("RenderProcess"); connect(m_qmlPuppetRenderProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus))); connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetRenderProcess.data(), SLOT(kill())); if (fowardQmlpuppetOutput) { m_qmlPuppetRenderProcess->setProcessChannelMode(QProcess::MergedChannels); connect(m_qmlPuppetRenderProcess.data(), SIGNAL(readyRead()), this, SLOT(printRenderProcessOutput())); } m_qmlPuppetRenderProcess->start(applicationPath, QStringList() << socketToken << "rendermode" << "-graphicssystem raster"); }
NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceView, RunModus runModus, const QString &pathToQt) : NodeInstanceServerInterface(nodeInstanceView), m_localServer(new QLocalServer(this)), m_nodeInstanceView(nodeInstanceView), m_firstBlockSize(0), m_secondBlockSize(0), m_thirdBlockSize(0), m_writeCommandCounter(0), m_firstLastReadCommandCounter(0), m_secondLastReadCommandCounter(0), m_thirdLastReadCommandCounter(0), m_runModus(runModus), m_synchronizeId(-1) { Q_UNUSED(pathToQt); QString socketToken(QUuid::createUuid().toString()); m_localServer->listen(socketToken); m_localServer->setMaxPendingConnections(3); QString applicationPath = pathToQt + QLatin1String("/bin"); if (runModus == TestModus) { applicationPath = QCoreApplication::applicationDirPath() + qmlPuppetApplicationDirectoryForTests() + qmlPuppetApplicationName(); } else { applicationPath = macOSBundlePath(applicationPath); applicationPath += QLatin1Char('/') + qmlPuppetApplicationName(); if (!QFileInfo(applicationPath).exists()) { //No qmlpuppet in Qt //We have to find out how to give not too intrusive feedback applicationPath = QCoreApplication::applicationDirPath(); applicationPath = macOSBundlePath(applicationPath); applicationPath += QLatin1Char('/') + qmlPuppetApplicationName(); } } QByteArray envImportPath = qgetenv("QTCREATOR_QMLPUPPET_PATH"); if (!envImportPath.isEmpty()) { applicationPath = envImportPath; } QProcessEnvironment enviroment = QProcessEnvironment::systemEnvironment(); if (QFileInfo(applicationPath).exists()) { m_qmlPuppetEditorProcess = new QProcess; m_qmlPuppetEditorProcess->setProcessEnvironment(enviroment); m_qmlPuppetEditorProcess->setObjectName("EditorProcess"); connect(m_qmlPuppetEditorProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus))); connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetEditorProcess.data(), SLOT(kill())); bool fowardQmlpuppetOutput = !qgetenv("FORWARD_QMLPUPPET_OUTPUT").isEmpty(); if (fowardQmlpuppetOutput) m_qmlPuppetEditorProcess->setProcessChannelMode(QProcess::ForwardedChannels); m_qmlPuppetEditorProcess->start(applicationPath, QStringList() << socketToken << "editormode" << "-graphicssystem raster"); if (runModus == NormalModus) { m_qmlPuppetPreviewProcess = new QProcess; m_qmlPuppetPreviewProcess->setProcessEnvironment(enviroment); m_qmlPuppetPreviewProcess->setObjectName("PreviewProcess"); connect(m_qmlPuppetPreviewProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus))); connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetPreviewProcess.data(), SLOT(kill())); if (fowardQmlpuppetOutput) m_qmlPuppetPreviewProcess->setProcessChannelMode(QProcess::ForwardedChannels); m_qmlPuppetPreviewProcess->start(applicationPath, QStringList() << socketToken << "previewmode" << "-graphicssystem raster"); m_qmlPuppetRenderProcess = new QProcess; m_qmlPuppetRenderProcess->setProcessEnvironment(enviroment); m_qmlPuppetRenderProcess->setObjectName("RenderProcess"); connect(m_qmlPuppetRenderProcess.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus))); connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), m_qmlPuppetRenderProcess.data(), SLOT(kill())); if (fowardQmlpuppetOutput) m_qmlPuppetRenderProcess->setProcessChannelMode(QProcess::ForwardedChannels); m_qmlPuppetRenderProcess->start(applicationPath, QStringList() << socketToken << "rendermode" << "-graphicssystem raster"); }