Allow to open the device when using the App Sandbox on OSX
authorDenis Shienkov <denis.shienkov@gmail.com>
Thu, 7 May 2015 17:55:39 +0000 (20:55 +0300)
committerDenis Shienkov <denis.shienkov@gmail.com>
Tue, 12 May 2015 13:08:48 +0000 (13:08 +0000)
commitad56086040e6b40565214380b083ecf986924f92
treedf6c471ededff82ff014efe42fce9dbca9a89c80
parentda396bc54b776da682ffdcd2aa61f504d607bc12
Allow to open the device when using the App Sandbox on OSX

When running the App Sandbox, a system has no any temporary directories
which can be shared between applications (or, maybe, it is configurable
option):

* https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AboutAppSandbox/AboutAppSandbox.html

In this case QSP::open() can not create a lock file that lead to fails
when opening.

Workaround it is to use the
QStandardPaths::writableLocation(QStandardPaths::TempLocation) for receiving
a temporal directory of application. Where the writableLocation() implicitly
uses the NSTemporaryDirectory function that is the recommended way
(see "The App Sandbox Container Directory") in here:

* https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW4

This will allow to open the serial port, but the locking feature will not
work properly.

Task-number: QTBUG-45338
Change-Id: Iea52aada11493126b0f58c40488c38c86f69fca5
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
src/serialport/qserialport_unix.cpp