| 352 | } |
| 353 | |
| 354 | void 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 | |
| 381 | void NotepadNextApplication::receiveInfoFromSecondaryInstance(quint32 instanceId, QByteArray message) |
| 382 | { |