summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-07-02 14:55:59 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2015-07-07 18:52:17 +0000
commit35aa1413c8c4878570786897a0df936fb36b4a17 (patch)
tree2846ab9ffe056d1611242baf14a9dfb1013bb519
parentb32740001f735be9f0938f85d325dc2cf3dbe598 (diff)
downloadqtserialport-35aa1413c8c4878570786897a0df936fb36b4a17.tar.gz
Fix the lock-file path when the App Sandbox is used on OSX
Commit ad56086040e6b40565214380b083ecf986924f92 does not solve it, because a lock-file path does not contain the device name, but now this issue is fixed. Task-number: QTBUG-45338 Change-Id: I876a588b035b8a8e97ff5af76f6833ae340bf7b5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r--src/serialport/qserialport_unix.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
index 65c45d5..d2c0eca 100644
--- a/src/serialport/qserialport_unix.cpp
+++ b/src/serialport/qserialport_unix.cpp
@@ -77,6 +77,10 @@ QString serialPortLockFilePath(const QString &portName)
<< QStringLiteral("/run/lock")
#ifdef Q_OS_ANDROID
<< QStringLiteral("/data/local/tmp")
+#elif defined(Q_OS_OSX)
+ // This is the workaround to specify a temporary directory
+ // on OSX when running the App Sandbox feature.
+ << QStandardPaths::writableLocation(QStandardPaths::TempLocation);
#endif
;
@@ -98,13 +102,6 @@ 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)