Bläddra i källkod

add debug release define

master
Robin Thoni 10 år sedan
förälder
incheckning
e8ee6b01aa
3 ändrade filer med 8 tillägg och 1 borttagningar
  1. 2
    0
      libptsocket/libptsocket.pro
  2. 1
    1
      libptsocket/ptsocket.h
  3. 5
    0
      tests/test.cpp

+ 2
- 0
libptsocket/libptsocket.pro Visa fil

@@ -16,6 +16,8 @@ DEFINES += LIBPTSOCKET_LIBRARY
16 16
 SOURCES += ptsocket.cpp \
17 17
     ptserver.cpp
18 18
 
19
+Debug:DEFINES += PT_DEBUG
20
+
19 21
 HEADERS += ptsocket.h\
20 22
         libptsocket_global.h \
21 23
     ptserver.h

+ 1
- 1
libptsocket/ptsocket.h Visa fil

@@ -8,7 +8,7 @@
8 8
 #include <QTimer>
9 9
 #include <QMetaEnum>
10 10
 
11
-#define PT_DEBUG
11
+//#define PT_DEBUG
12 12
 
13 13
 class LIBPTSOCKETSHARED_EXPORT PTSocket : public QTcpSocket
14 14
 {

+ 5
- 0
tests/test.cpp Visa fil

@@ -2,6 +2,11 @@
2 2
 
3 3
 Test::Test(QObject *parent) : QObject(parent)
4 4
 {
5
+#ifdef PT_DEBUG
6
+    qDebug()<<"Debug mode";
7
+#else
8
+    qDebug()<<"Release mode";
9
+#endif
5 10
     m_serv = new PTServer(this);
6 11
     m_timeoutTimer.setSingleShot(true);
7 12
     connect(&m_timeoutTimer, SIGNAL(timeout()), this, SLOT(timedout()));

Laddar…
Avbryt
Spara