termux-packages/x11-packages/qt-creator/qtsingleapplication_no_shar...

37 lines
1.1 KiB
Diff

--- src/src/shared/qtsingleapplication/qtsingleapplication.cpp 2020-07-07 06:44:20.000000000 +0000
+++ src.mod/src/shared/qtsingleapplication/qtsingleapplication.cpp 2021-05-24 10:25:32.415055562 +0000
@@ -53,6 +53,10 @@
{
this->appId = appId;
+#ifdef QT_NO_SHAREDMEMORY
+ instances = 0;
+ return;
+#else
const QString appSessionId = QtLocalPeer::appSessionId(appId);
// This shared memory holds a zero-terminated array of active (or crashed) instances
@@ -94,12 +98,14 @@
connect(pidPeer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::messageReceived);
pidPeer->isClient();
lockfile.unlock();
+#endif
}
QtSingleApplication::~QtSingleApplication()
{
if (!instances)
return;
+#ifndef QT_NO_SHAREDMEMORY
const qint64 appPid = QCoreApplication::applicationPid();
QtLockedFile lockfile(instancesLockFilename(QtLocalPeer::appSessionId(appId)));
lockfile.open(QtLockedFile::ReadWrite);
@@ -113,6 +119,7 @@
}
*newpids = 0;
lockfile.unlock();
+#endif
}
bool QtSingleApplication::event(QEvent *event)