Browse Source

qt version; debug functions hidden

master
Robin Thoni 9 years ago
parent
commit
eab7fd81ed
4 changed files with 13 additions and 13 deletions
  1. 5
    2
      libptsocket.pro
  2. 2
    8
      ptsocket/ptsocket.cpp
  3. 2
    2
      ptsocket/ptsocket.h
  4. 4
    1
      ptsocket/ptsocket.pro

+ 5
- 2
libptsocket.pro View File

@@ -1,5 +1,8 @@
1 1
 TEMPLATE = subdirs
2 2
 
3 3
 SUBDIRS += \
4
-    ptsocket \
5
-    tests
4
+    ptsocket
5
+
6
+contains (DEFINES, PT_DEBUG) {
7
+    SUBDIRS += tests
8
+}

+ 2
- 8
ptsocket/ptsocket.cpp View File

@@ -89,45 +89,39 @@ void PTSocket::disconnectFromServer()
89 89
     disconnectFromHost();
90 90
 }
91 91
 
92
+#ifdef PT_DEBUG
92 93
 void PTSocket::dbgSetWillPing(bool w)
93 94
 {
94
-#ifdef PT_DEBUG
95 95
     m_willPing = w;
96
-#endif
97 96
 }
98 97
 
99 98
 void PTSocket::dbgSetWillHandshake(bool w)
100 99
 {
101
-#ifdef PT_DEBUG
102 100
     m_willHandshake = w;
103 101
     m_willHandshakeFake1 = false;
104 102
     m_willHandshakeFake2 = false;
105
-#endif
106 103
 }
107 104
 
108 105
 void PTSocket::dbgSetWillHandshakeFake1(bool w)
109 106
 {
110
-#ifdef PT_DEBUG
111 107
     m_willHandshakeFake1 = w;
112 108
     if(!w)
113 109
         m_willHandshake = true;
114 110
     else
115 111
         m_willHandshake = false;
116 112
     m_willHandshakeFake2 = false;
117
-#endif
118 113
 }
119 114
 
120 115
 void PTSocket::dbgSetWillHandshakeFake2(bool w)
121 116
 {
122
-#ifdef PT_DEBUG
123 117
     m_willHandshakeFake2 = w;
124 118
     if(!w)
125 119
         m_willHandshake = true;
126 120
     else
127 121
         m_willHandshake = false;
128 122
     m_willHandshakeFake1 = false;
129
-#endif
130 123
 }
124
+#endif
131 125
 
132 126
 void PTSocket::send(bool sys, int pktType, QByteArray data)
133 127
 {

+ 2
- 2
ptsocket/ptsocket.h View File

@@ -46,10 +46,12 @@ public slots:
46 46
     void send(int pktType, QByteArray data);
47 47
     void disconnectFromServer();
48 48
 
49
+#ifdef PT_DEBUG
49 50
     void dbgSetWillPing(bool w);
50 51
     void dbgSetWillHandshake(bool w);
51 52
     void dbgSetWillHandshakeFake1(bool w);
52 53
     void dbgSetWillHandshakeFake2(bool w);
54
+#endif
53 55
 
54 56
 private slots:
55 57
     void m_ping();
@@ -82,8 +84,6 @@ private:
82 84
     bool m_willHandshakeFake1;
83 85
     bool m_willHandshakeFake2;
84 86
 #endif
85
-#ifdef PT_DEBUG
86
-#endif
87 87
 };
88 88
 
89 89
 QDebug operator <<(QDebug dbg, const PTSocket::State s);

+ 4
- 1
ptsocket/ptsocket.pro View File

@@ -1,7 +1,10 @@
1 1
 QT       += network
2 2
 QT       -= gui
3 3
 include(../commons.pri)
4
-TARGET = ptsocket
4
+
5
+TARGET = ptsocketqt$$QT_MAJOR_VERSION
6
+
7
+
5 8
 TEMPLATE = lib
6 9
 DEFINES += LIBPTSOCKET_LIBRARY
7 10
 

Loading…
Cancel
Save