Line 0
Link Here
|
|
|
1 |
# Some workaround after v1.7.0 update, because previous (1.6.16) version of |
2 |
# focuswriter application may create empty /tmp/qtsingleapp-*-lockfile file |
3 |
# after first run, which may prevent newer application to run. |
4 |
|
5 |
--- src/qtsingleapplication/qtlocalpeer.cpp.orig 2018-12-11 18:42:05 UTC |
6 |
+++ src/qtsingleapplication/qtlocalpeer.cpp |
7 |
@@ -95,6 +95,17 @@ QtLocalPeer::QtLocalPeer(QObject* parent |
8 |
QString lockName = QDir(QDir::tempPath()).absolutePath() |
9 |
+ QLatin1Char('/') + socketName |
10 |
+ QLatin1String("-lockfile"); |
11 |
+#if defined(Q_OS_UNIX) |
12 |
+{ |
13 |
+ QFile file(lockName); |
14 |
+ if (file.exists() && file.open(QIODevice::ReadOnly)) { |
15 |
+ bool isEmpty = (file.size() == 0); |
16 |
+ file.close(); |
17 |
+ if (isEmpty) |
18 |
+ QFile::remove(lockName); |
19 |
+ } |
20 |
+} |
21 |
+#endif |
22 |
lockFile = new QLockFile(lockName); |
23 |
lockFile->setStaleLockTime(0); |
24 |
#if defined(Q_OS_WIN) |