Skip to content

Commit cfddf4f

Browse files
Small build and styleguide fixes
1 parent 2c37ad6 commit cfddf4f

30 files changed

+74
-115
lines changed

qslog/QsLog.pri

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@ INCLUDEPATH += $$PWD
33
# WARNING: QS_LOG_LINE_NUMBERS and QS_LOG_SEPARATE_THREAD were removed from repo version and made enabled by default
44
#DEFINES += QS_LOG_DISABLE # logging code is replaced with a no-op
55

6-
SOURCES += $$PWD/QsLogDest.cpp \
7-
$$PWD/QsLog.cpp \
8-
$$PWD/QsLogDestConsole.cpp \
9-
$$PWD/QsLogDestFile.cpp \
10-
$$PWD/QsLogDestFunctor.cpp
6+
SOURCES += \
7+
$$PWD/QsLogDest.cpp \
8+
$$PWD/QsLog.cpp \
9+
$$PWD/QsLogDestConsole.cpp \
10+
$$PWD/QsLogDestFile.cpp \
11+
$$PWD/QsLogDestFunctor.cpp
1112

12-
HEADERS += $$PWD/QsLogDest.h \
13-
$$PWD/QsLog.h \
14-
$$PWD/QsLogDestConsole.h \
15-
$$PWD/QsLogLevel.h \
16-
$$PWD/QsLogDestFile.h \
17-
$$PWD/QsLogDisableForThisFile.h \
18-
$$PWD/QsLogDestFunctor.h
13+
HEADERS += \
14+
$$PWD/QsLogDest.h \
15+
$$PWD/QsLog.h \
16+
$$PWD/QsLogDestConsole.h \
17+
$$PWD/QsLogLevel.h \
18+
$$PWD/QsLogDestFile.h \
19+
$$PWD/QsLogDisableForThisFile.h \
20+
$$PWD/QsLogDestFunctor.h
1921

2022
OTHER_FILES += \
21-
$$PWD/QsLogChanges.txt \
22-
$$PWD/QsLogReadme.txt \
23-
$$PWD/LICENSE.txt
23+
$$PWD/QsLogChanges.txt \
24+
$$PWD/QsLogReadme.txt \
25+
$$PWD/LICENSE.txt

qslog/QsLogSharedLibrary.pro

Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,16 @@
11
# This pro file will build QsLog as a shared library
2-
include(QsLog.pri)
3-
4-
CROSS_COMPILE = $$(CROSS_COMPILE)
5-
6-
!isEmpty(CROSS_COMPILE) {
7-
ARCHITECTURE = arm
8-
} else {
9-
ARCHITECTURE = x86
10-
}
11-
12-
CONFIG(debug, debug | release) {
13-
CONFIGURATION = $$ARCHITECTURE-debug
14-
CONFIGURATION_SUFFIX = -$$ARCHITECTURE-d
15-
} else {
16-
CONFIGURATION = $$ARCHITECTURE-release
17-
equals(ARCHITECTURE, "arm") {
18-
CONFIGURATION_SUFFIX =
19-
} else {
20-
CONFIGURATION_SUFFIX = -$$ARCHITECTURE
21-
}
22-
}
2+
include(../global.pri)
233

24-
DESTDIR = $$PWD/../bin/$$CONFIGURATION
25-
26-
equals(TEMPLATE, app) {
27-
!macx {
28-
QMAKE_LFLAGS += -Wl,-O1,-rpath,.
29-
QMAKE_LFLAGS += -Wl,-rpath-link,$$DESTDIR
30-
}
31-
}
32-
33-
OBJECTS_DIR = .build/$$CONFIGURATION/.obj
34-
MOC_DIR = .build/$$CONFIGURATION/.moc
35-
RCC_DIR = .build/$$CONFIGURATION/.rcc
36-
UI_DIR = .build/$$CONFIGURATION/.ui
4+
include(QsLog.pri)
375

386
TARGET = qslog$$CONFIGURATION_SUFFIX
7+
398
QT -= gui
9+
4010
CONFIG -= console
4111
CONFIG -= app_bundle
4212
CONFIG += shared
43-
TEMPLATE = lib
44-
45-
QMAKE_CXXFLAGS += -std=c++11
46-
QMAKE_CXXFLAGS += -Wextra -Wcast-qual -Wwrite-strings -Wredundant-decls -Wunreachable-code -Wnon-virtual-dtor -Woverloaded-virtual
47-
48-
win32 {
49-
DEFINES += QSLOG_IS_SHARED_LIBRARY
50-
}
5113

52-
unix:!macx {
53-
# make install will install the shared object in the appropriate folders
54-
headers.files = QsLog.h QsLogDest.h QsLogLevel.h
55-
headers.path = /usr/include/$(QMAKE_TARGET)
56-
57-
other_files.files = *.txt
58-
other_files.path = /usr/local/share/$(QMAKE_TARGET)
59-
60-
contains(QT_ARCH, x86_64) {
61-
target.path = /usr/lib64
62-
} else {
63-
target.path = /usr/lib
64-
}
14+
TEMPLATE = lib
6515

66-
INSTALLS += headers target other_files
67-
}
16+
DEFINES += QSLOG_IS_SHARED_LIBRARY

trikCommunicator/src/connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "src/connection.h"
2424

25-
#include "QsLog.h"
25+
#include <QsLog.h>
2626

2727
using namespace trikCommunicator;
2828

trikControl/src/analogSensor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include "i2cCommunicator.h"
2020

21-
#include "QsLog.h"
21+
#include <QsLog.h>
2222

2323
using namespace trikControl;
2424

trikControl/src/brick.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "configurer.h"
2828
#include "i2cCommunicator.h"
2929

30-
#include "QsLog.h"
30+
#include <QsLog.h>
3131

3232
using namespace trikControl;
3333

trikControl/src/configurer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <QtCore/QFile>
1919
#include <QtCore/QDebug>
2020

21-
#include "QsLog.h"
21+
#include <QsLog.h>
2222

2323
using namespace trikControl;
2424

trikControl/src/digitalSensor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include <QtCore/QDebug>
1818

19-
#include "QsLog.h"
19+
#include <QsLog.h>
2020

2121
using namespace trikControl;
2222

trikControl/src/gamepad.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include "tcpConnector.h"
2020

21-
#include "QsLog.h"
21+
#include <QsLog.h>
2222

2323
using namespace trikControl;
2424

trikControl/src/led.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include <QtCore/QDebug>
1818

19-
#include "QsLog.h"
19+
#include <QsLog.h>
2020

2121
using namespace trikControl;
2222

trikControl/src/linux/abstractVirtualSensorWorker.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <fcntl.h>
2222
#include <errno.h>
2323

24-
#include "QsLog.h"
24+
#include <QsLog.h>
2525

2626
using namespace trikControl;
2727

@@ -180,8 +180,10 @@ void AbstractVirtualSensorWorker::openFifos()
180180

181181
mReady = true;
182182

183-
QLOG_INFO() << sensorName() << "initialization completed";
184-
qDebug() << sensorName() << "initialization completed";
183+
QString const message = sensorName() + " initialization completed";
184+
185+
QLOG_INFO() << message;
186+
qDebug() << message;
185187

186188
sync();
187189
}
@@ -200,18 +202,22 @@ void AbstractVirtualSensorWorker::deinitialize()
200202
}
201203

202204
if (::close(mOutputFileDescriptor) != 0) {
203-
QLOG_ERROR() << mOutputFile.fileName() << ": fifo close failed: " << errno;
204-
qDebug() << mOutputFile.fileName() << ": fifo close failed: " << errno;
205+
QString const message = QString("%1: fifo close failed: %2").arg(mOutputFile.fileName()).arg(errno);
206+
QLOG_ERROR() << message;
207+
qDebug() << message;
205208
}
206209

207210
mOutputFileDescriptor = -1;
208211
mInputFile.close();
209212

210213
if (!launchSensorScript("stop")) {
211-
QLOG_ERROR() << "Failed to stop" << sensorName() << "sensor!";
212-
qDebug() << "Failed to stop" << sensorName() << "sensor!";
214+
QString const message = QString("Failed to stop %1 sensor!").arg(sensorName());
215+
QLOG_ERROR() << message;
216+
qDebug() << message;
213217
} else {
214-
qDebug() << "Successfully stopped" << sensorName() << "sensor";
218+
QString const message = QString("Successfully stopped %1 sensor").arg(sensorName());
219+
QLOG_INFO() << message;
220+
qDebug() << message;
215221
}
216222

217223
emit stopped();

0 commit comments

Comments
 (0)