summaryrefslogtreecommitdiff
path: root/dev-qt/qtsingleapplication/files/2.6.1_p20130904-unbundle-qtlockedfile.patch
blob: 93c78fab9bab99a52803f9c4bf49ddb068158f4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
From 62210d463f87abb0584ce699915e1845cacaa480 Mon Sep 17 00:00:00 2001
From: Davide Pesavento <davidepesa@gmail.com>
Date: Sat, 28 Dec 2013 16:33:15 +0100
Subject: [PATCH] unbundle qtlockedfile

---
 src/qtlocalpeer.cpp             | 11 +----------
 src/qtlocalpeer.h               |  2 +-
 src/qtsingleapplication.pri     |  1 +
 src/qtsinglecoreapplication.pri |  1 +
 4 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/qtlocalpeer.cpp b/src/qtlocalpeer.cpp
index 332b064..f17e662 100644
--- a/src/qtlocalpeer.cpp
+++ b/src/qtlocalpeer.cpp
@@ -55,15 +55,6 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0;
 #include <unistd.h>
 #endif
 
-namespace QtLP_Private {
-#include "qtlockedfile.cpp"
-#if defined(Q_OS_WIN)
-#include "qtlockedfile_win.cpp"
-#else
-#include "qtlockedfile_unix.cpp"
-#endif
-}
-
 const char* QtLocalPeer::ack = "ack";
 
 QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
@@ -114,7 +105,7 @@ bool QtLocalPeer::isClient()
     if (lockFile.isLocked())
         return false;
 
-    if (!lockFile.lock(QtLP_Private::QtLockedFile::WriteLock, false))
+    if (!lockFile.lock(QtLockedFile::WriteLock, false))
         return true;
 
     bool res = server->listen(socketName);
diff --git a/src/qtlocalpeer.h b/src/qtlocalpeer.h
index 1b533b1..1127735 100644
--- a/src/qtlocalpeer.h
+++ b/src/qtlocalpeer.h
@@ -68,7 +68,7 @@ protected:
     QString id;
     QString socketName;
     QLocalServer* server;
-    QtLP_Private::QtLockedFile lockFile;
+    QtLockedFile lockFile;
 
 private:
     static const char* ack;
diff --git a/src/qtsingleapplication.pri b/src/qtsingleapplication.pri
index 6f2bced..02c9e5b 100644
--- a/src/qtsingleapplication.pri
+++ b/src/qtsingleapplication.pri
@@ -3,6 +3,7 @@ INCLUDEPATH += $$PWD
 DEPENDPATH += $$PWD
 QT *= network
 greaterThan(QT_MAJOR_VERSION, 4): QT *= widgets
+CONFIG *= qtlockedfile
 
 qtsingleapplication-uselib:!qtsingleapplication-buildlib {
     LIBS += -L$$QTSINGLEAPPLICATION_LIBDIR -l$$QTSINGLEAPPLICATION_LIBNAME
diff --git a/src/qtsinglecoreapplication.pri b/src/qtsinglecoreapplication.pri
index d2d6cc3..f5b8414 100644
--- a/src/qtsinglecoreapplication.pri
+++ b/src/qtsinglecoreapplication.pri
@@ -4,6 +4,7 @@ HEADERS		+= $$PWD/qtsinglecoreapplication.h $$PWD/qtlocalpeer.h
 SOURCES		+= $$PWD/qtsinglecoreapplication.cpp $$PWD/qtlocalpeer.cpp
 
 QT *= network
+CONFIG *= qtlockedfile
 
 win32:contains(TEMPLATE, lib):contains(CONFIG, shared) {
     DEFINES += QT_QTSINGLECOREAPPLICATION_EXPORT=__declspec(dllexport)
-- 
1.8.5.2