MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / sendInfoToPrimaryInstance

Method sendInfoToPrimaryInstance

src/NotepadNextApplication.cpp:354–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354void NotepadNextApplication::sendInfoToPrimaryInstance()
355{
356 qInfo(Q_FUNC_INFO);
357
358 QStringList argsToSend;
359 const QStringList positionalArguments = parser.positionalArguments();
360
361 // Any positional arguments need translated into an absolute file path relative to this instance
362 for (const QString &arg : arguments()) {
363 if (positionalArguments.contains(arg)) {
364 QFileInfo fileInfo(arg);
365 argsToSend.append(fileInfo.absoluteFilePath());
366 } else {
367 argsToSend.append(arg);
368 }
369 }
370
371 QByteArray buffer;
372 QDataStream stream(&buffer, QIODevice::WriteOnly);
373 stream << argsToSend;
374
375 const bool success = sendMessage(buffer);
376 if (!success) {
377 qWarning("sendMessage() unsuccessful");
378 }
379}
380
381void NotepadNextApplication::receiveInfoFromSecondaryInstance(quint32 instanceId, QByteArray message)
382{

Callers 1

mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected