summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2017-10-23 16:02:43 (GMT)
committerDenis Shienkov <denis.shienkov@gmail.com>2017-10-25 07:44:45 (GMT)
commitd9030bb9da8d7b472f86513e8695c442a43f19e7 (patch)
tree584f855ecb333c7355f08d3bdf2ab7a444ed2fdb
parent95d7c69a471c3568a87f35991fc298f9bec44383 (diff)
downloadqtserialport-d9030bb9da8d7b472f86513e8695c442a43f19e7.tar.gz
Allow more paths for lookup of lock-file directories
It makes sense to use the QStandardPaths::writableLocation(QStandardPaths::TempLocation) directory for any of Unix-like platforms, as a 'last resort' to store the lock-files, if no other preferable directory was found. Change-Id: Ifd1a5789c014388509b29837171d3fdc440d63e6 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/serialport/qserialport_unix.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
index 4f5203e..5d35446 100644
--- a/src/serialport/qserialport_unix.cpp
+++ b/src/serialport/qserialport_unix.cpp
@@ -98,10 +98,7 @@ struct termios2 {
#include <QtCore/qelapsedtimer.h>
#include <QtCore/qsocketnotifier.h>
#include <QtCore/qmap.h>
-
-#ifdef Q_OS_OSX
#include <QtCore/qstandardpaths.h>
-#endif
QT_BEGIN_NAMESPACE
@@ -118,12 +115,8 @@ 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
- ;
+ << QStandardPaths::writableLocation(QStandardPaths::TempLocation);
QString fileName = portName;
fileName.replace(QLatin1Char('/'), QLatin1Char('_'));