diff options
Diffstat (limited to 'src/serialport/qserialport_unix.cpp')
-rw-r--r-- | src/serialport/qserialport_unix.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp index 9048a3b..1f90a18 100644 --- a/src/serialport/qserialport_unix.cpp +++ b/src/serialport/qserialport_unix.cpp @@ -58,6 +58,10 @@ #include <QtCore/qsocketnotifier.h> #include <QtCore/qmap.h> +#ifdef Q_OS_MAC +#include <QtCore/qstandardpaths.h> +#endif + QT_BEGIN_NAMESPACE QString serialPortLockFilePath(const QString &portName) @@ -94,6 +98,13 @@ QString serialPortLockFilePath(const QString &portName) } } +#ifdef Q_OS_MAC + // This is the workaround to specify a temporary directory + // on OSX when running the App Sandbox feature. + if (lockFilePath.isEmpty()) + lockFilePath = QStandardPaths::writableLocation(QStandardPaths::TempLocation); +#endif + if (lockFilePath.isEmpty()) { qWarning("The following directories are not readable or writable for detaling with lock files\n"); foreach (const QString &lockDirectoryPath, lockDirectoryPaths) |