Kaynağa Gözat

qt version; debug functions hidden

master
Robin Thoni 8 yıl önce
ebeveyn
işleme
eab7fd81ed
4 değiştirilmiş dosya ile 13 ekleme ve 13 silme
  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 Dosyayı Görüntüle

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

+ 2
- 8
ptsocket/ptsocket.cpp Dosyayı Görüntüle

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

+ 2
- 2
ptsocket/ptsocket.h Dosyayı Görüntüle

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

+ 4
- 1
ptsocket/ptsocket.pro Dosyayı Görüntüle

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

Loading…
İptal
Kaydet