Browse Source

add debug release define

master
Robin Thoni 11 years ago
parent
commit
e8ee6b01aa
3 changed files with 8 additions and 1 deletions
  1. 2
    0
      libptsocket/libptsocket.pro
  2. 1
    1
      libptsocket/ptsocket.h
  3. 5
    0
      tests/test.cpp

+ 2
- 0
libptsocket/libptsocket.pro View File

16
 SOURCES += ptsocket.cpp \
16
 SOURCES += ptsocket.cpp \
17
     ptserver.cpp
17
     ptserver.cpp
18
 
18
 
19
+Debug:DEFINES += PT_DEBUG
20
+
19
 HEADERS += ptsocket.h\
21
 HEADERS += ptsocket.h\
20
         libptsocket_global.h \
22
         libptsocket_global.h \
21
     ptserver.h
23
     ptserver.h

+ 1
- 1
libptsocket/ptsocket.h View File

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

+ 5
- 0
tests/test.cpp View File

2
 
2
 
3
 Test::Test(QObject *parent) : QObject(parent)
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
     m_serv = new PTServer(this);
10
     m_serv = new PTServer(this);
6
     m_timeoutTimer.setSingleShot(true);
11
     m_timeoutTimer.setSingleShot(true);
7
     connect(&m_timeoutTimer, SIGNAL(timeout()), this, SLOT(timedout()));
12
     connect(&m_timeoutTimer, SIGNAL(timeout()), this, SLOT(timedout()));

Loading…
Cancel
Save