diff --git a/ground/openpilotgcs/openpilotgcs.pri b/ground/openpilotgcs/openpilotgcs.pri index 7dfc71545..b9da7f671 100644 --- a/ground/openpilotgcs/openpilotgcs.pri +++ b/ground/openpilotgcs/openpilotgcs.pri @@ -19,6 +19,19 @@ defineReplace(addNewline) { return($$escape_expand(\\n\\t)) } +defineReplace(qtLibraryName) { + unset(LIBRARY_NAME) + LIBRARY_NAME = $$1 + CONFIG(debug, debug|release) { + !debug_and_release|build_pass { + mac:RET = $$member(LIBRARY_NAME, 0)_debug + else:win32:RET = $$member(LIBRARY_NAME, 0)d + } + } + isEmpty(RET):RET = $$LIBRARY_NAME + return($$RET) +} + # For use in custom compilers which just copy files win32:i_flag = i defineReplace(stripSrcDir) { diff --git a/ground/openpilotgcs/src/app/app.pro b/ground/openpilotgcs/src/app/app.pro index 4b1534ad9..c644f7c97 100644 --- a/ground/openpilotgcs/src/app/app.pro +++ b/ground/openpilotgcs/src/app/app.pro @@ -11,16 +11,15 @@ SOURCES += main.cpp include(../rpath.pri) include(../libs/utils/utils.pri) -win32 { - CONFIG(debug, debug|release):LIBS *= -lExtensionSystemd -lAggregationd -lQExtSerialPortd - else:LIBS *= -lExtensionSystem -lAggregation -lQExtSerialPort +LIBS *= -l$$qtLibraryName(ExtensionSystem) -l$$qtLibraryName(Aggregation) +win32 { +# CONFIG(debug, debug|release):LIBS *= -lExtensionSystemd -lAggregationd -lQExtSerialPortd +# else:LIBS *= -lExtensionSystem -lAggregation -lQExtSerialPort RC_FILE = openpilotgcs.rc target.path = /bin INSTALLS += target } else:macx { - CONFIG(debug, debug|release):LIBS *= -lExtensionSystem_debug -lAggregation_debug - else:LIBS *= -lExtensionSystem -lAggregation LIBS += -framework CoreFoundation ICON = openpilotgcs.icns QMAKE_INFO_PLIST = Info.plist @@ -28,8 +27,6 @@ win32 { FILETYPES.path = Contents/Resources QMAKE_BUNDLE_DATA += FILETYPES } else { - LIBS *= -lExtensionSystem -lAggregation - target.path = /bin INSTALLS += target } diff --git a/ground/openpilotgcs/src/libs/aggregation/aggregation.pri b/ground/openpilotgcs/src/libs/aggregation/aggregation.pri index a6c48c59c..fc6ddc81f 100644 --- a/ground/openpilotgcs/src/libs/aggregation/aggregation.pri +++ b/ground/openpilotgcs/src/libs/aggregation/aggregation.pri @@ -1 +1 @@ -LIBS *= -l$$qtLibraryTarget(Aggregation) +LIBS *= -l$$qtLibraryName(Aggregation) diff --git a/ground/openpilotgcs/src/libs/extensionsystem/extensionsystem.pri b/ground/openpilotgcs/src/libs/extensionsystem/extensionsystem.pri index 43855eb16..4c7641b9c 100644 --- a/ground/openpilotgcs/src/libs/extensionsystem/extensionsystem.pri +++ b/ground/openpilotgcs/src/libs/extensionsystem/extensionsystem.pri @@ -1,3 +1,3 @@ include(extensionsystem_dependencies.pri) -LIBS *= -l$$qtLibraryTarget(ExtensionSystem) +LIBS *= -l$$qtLibraryName(ExtensionSystem) diff --git a/ground/openpilotgcs/src/libs/glc_lib/glc_lib.pri b/ground/openpilotgcs/src/libs/glc_lib/glc_lib.pri index 58610bcaa..d3199ba3a 100644 --- a/ground/openpilotgcs/src/libs/glc_lib/glc_lib.pri +++ b/ground/openpilotgcs/src/libs/glc_lib/glc_lib.pri @@ -1,2 +1,2 @@ QT += opengl -LIBS += -l$$qtLibraryTarget(GLC_lib) +LIBS *= -l$$qtLibraryName(GLC_lib) diff --git a/ground/openpilotgcs/src/libs/libqxt/libqxt.pri b/ground/openpilotgcs/src/libs/libqxt/libqxt.pri index d2001f6fe..1886943d5 100644 --- a/ground/openpilotgcs/src/libs/libqxt/libqxt.pri +++ b/ground/openpilotgcs/src/libs/libqxt/libqxt.pri @@ -1,4 +1,4 @@ -LIBS += -l$$qtLibraryTarget(QxtCore) +LIBS *= -l$$qtLibraryName(QxtCore) INCLUDEPATH += \ $$GCS_SOURCE_TREE/src/libs/libqxt/src/core diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/opmapcontrol.pri b/ground/openpilotgcs/src/libs/opmapcontrol/opmapcontrol.pri index 9c0188c30..f6ea6004b 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/opmapcontrol.pri +++ b/ground/openpilotgcs/src/libs/opmapcontrol/opmapcontrol.pri @@ -1 +1 @@ -LIBS *= -l$$qtLibraryTarget(opmapwidget) +LIBS *= -l$$qtLibraryName(opmapwidget) diff --git a/ground/openpilotgcs/src/libs/qextserialport/qextserialport.pri b/ground/openpilotgcs/src/libs/qextserialport/qextserialport.pri index 1f89982c5..286b70b87 100644 --- a/ground/openpilotgcs/src/libs/qextserialport/qextserialport.pri +++ b/ground/openpilotgcs/src/libs/qextserialport/qextserialport.pri @@ -1,2 +1,2 @@ -LIBS += -l$$qtLibraryTarget(QExtSerialPort) +LIBS *= -l$$qtLibraryName(QExtSerialPort) diff --git a/ground/openpilotgcs/src/libs/qscispinbox/qscispinbox.pri b/ground/openpilotgcs/src/libs/qscispinbox/qscispinbox.pri index 3d63b6605..85cd57253 100644 --- a/ground/openpilotgcs/src/libs/qscispinbox/qscispinbox.pri +++ b/ground/openpilotgcs/src/libs/qscispinbox/qscispinbox.pri @@ -1 +1 @@ -LIBS *= -l$$qtLibraryTarget(QScienceSpinBox) +LIBS *= -l$$qtLibraryName(QScienceSpinBox) diff --git a/ground/openpilotgcs/src/libs/qtconcurrent/qtconcurrent.pri b/ground/openpilotgcs/src/libs/qtconcurrent/qtconcurrent.pri index 57929a4cf..141de8ee8 100644 --- a/ground/openpilotgcs/src/libs/qtconcurrent/qtconcurrent.pri +++ b/ground/openpilotgcs/src/libs/qtconcurrent/qtconcurrent.pri @@ -1 +1 @@ -LIBS *= -l$$qtLibraryTarget(QtConcurrent) +LIBS *= -l$$qtLibraryName(QtConcurrent) diff --git a/ground/openpilotgcs/src/libs/qwt/qwt.pri b/ground/openpilotgcs/src/libs/qwt/qwt.pri index 4241b6278..7d57a8ce7 100644 --- a/ground/openpilotgcs/src/libs/qwt/qwt.pri +++ b/ground/openpilotgcs/src/libs/qwt/qwt.pri @@ -1,2 +1,2 @@ -LIBS += -l$$qtLibraryTarget(Qwt) +LIBS *= -l$$qtLibraryName(Qwt) diff --git a/ground/openpilotgcs/src/libs/sdlgamepad/sdlgamepad.pri b/ground/openpilotgcs/src/libs/sdlgamepad/sdlgamepad.pri index 01fd85523..a5d13203c 100644 --- a/ground/openpilotgcs/src/libs/sdlgamepad/sdlgamepad.pri +++ b/ground/openpilotgcs/src/libs/sdlgamepad/sdlgamepad.pri @@ -1 +1 @@ -LIBS += -l$$qtLibraryTarget(sdlgamepad) +LIBS *= -l$$qtLibraryName(sdlgamepad) diff --git a/ground/openpilotgcs/src/libs/utils/utils.pri b/ground/openpilotgcs/src/libs/utils/utils.pri index 5f35399b9..f6e523b74 100644 --- a/ground/openpilotgcs/src/libs/utils/utils.pri +++ b/ground/openpilotgcs/src/libs/utils/utils.pri @@ -1,9 +1 @@ -macx { - CONFIG(debug, debug|release):LIBS *= -lUtils_debug - else:LIBS *= -lUtils -} else:win32 { - CONFIG(debug, debug|release):LIBS *= -lUtilsd - else:LIBS *= -lUtils -} else { - LIBS += -l$$qtLibraryTarget(Utils) -} +LIBS *= -l$$qtLibraryName(Utils) diff --git a/ground/openpilotgcs/src/openpilotgcslibrary.pri b/ground/openpilotgcs/src/openpilotgcslibrary.pri index 9aa6f00d2..55fe13114 100644 --- a/ground/openpilotgcs/src/openpilotgcslibrary.pri +++ b/ground/openpilotgcs/src/openpilotgcslibrary.pri @@ -8,7 +8,7 @@ DESTDIR = $$GCS_LIBRARY_PATH include(rpath.pri) -TARGET = $$qtLibraryTarget($$TARGET) +TARGET = $$qtLibraryName($$TARGET) contains(QT_CONFIG, reduce_exports):CONFIG += hGCS_symbols diff --git a/ground/openpilotgcs/src/openpilotgcsplugin.pri b/ground/openpilotgcs/src/openpilotgcsplugin.pri index 9668a2e66..d274b71e8 100644 --- a/ground/openpilotgcs/src/openpilotgcsplugin.pri +++ b/ground/openpilotgcs/src/openpilotgcsplugin.pri @@ -23,7 +23,7 @@ copy2build.name = COPY ${QMAKE_FILE_IN} copy2build.CONFIG += no_link QMAKE_EXTRA_COMPILERS += copy2build -TARGET = $$qtLibraryTarget($$TARGET) +TARGET = $$qtLibraryName($$TARGET) macx { QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Plugins/$${PROVIDER}/ diff --git a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pri b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pri index fc5fc7aae..26143cbc1 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pri +++ b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pri @@ -1,2 +1,2 @@ include(coreplugin_dependencies.pri) -LIBS *= -l$$qtLibraryTarget(Core) +LIBS *= -l$$qtLibraryName(Core) diff --git a/ground/openpilotgcs/src/plugins/dial/dialgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/dial/dialgadgetwidget.cpp index a3bdebe42..ba6f35f19 100644 --- a/ground/openpilotgcs/src/plugins/dial/dialgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/dial/dialgadgetwidget.cpp @@ -478,13 +478,13 @@ void DialGadgetWidget::setDialFont(QString fontProps) // this enables smooth rotation in rotateNeedles below void DialGadgetWidget::setNeedle1(double value) { if (rotateN1) { - needle1Target = 360*(value*n1Factor-n1MinValue)/(n1MaxValue-n1MinValue); + needle1Target = 360*(value*n1Factor)/(n1MaxValue-n1MinValue); } if (horizN1) { - needle1Target = (value*n1Factor-n1MinValue)/(n1MaxValue-n1MinValue); + needle1Target = (value*n1Factor)/(n1MaxValue-n1MinValue); } if (vertN1) { - needle1Target = (value*n1Factor-n1MinValue)/(n1MaxValue-n1MinValue); + needle1Target = (value*n1Factor)/(n1MaxValue-n1MinValue); } if (!dialTimer.isActive()) dialTimer.start(); @@ -497,13 +497,13 @@ void DialGadgetWidget::setNeedle1(double value) { void DialGadgetWidget::setNeedle2(double value) { if (rotateN2) { - needle2Target = 360*(value*n2Factor-n2MinValue)/(n2MaxValue-n2MinValue); + needle2Target = 360*(value*n2Factor)/(n2MaxValue-n2MinValue); } if (horizN2) { - needle2Target = (value*n2Factor-n2MinValue)/(n2MaxValue-n2MinValue); + needle2Target = (value*n2Factor)/(n2MaxValue-n2MinValue); } if (vertN2) { - needle2Target = (value*n2Factor-n2MinValue)/(n2MaxValue-n2MinValue); + needle2Target = (value*n2Factor)/(n2MaxValue-n2MinValue); } if (!dialTimer.isActive()) dialTimer.start(); @@ -517,13 +517,13 @@ void DialGadgetWidget::setNeedle2(double value) { void DialGadgetWidget::setNeedle3(double value) { if (rotateN3) { - needle3Target = 360*(value*n3Factor-n3MinValue)/(n3MaxValue-n3MinValue); + needle3Target = 360*(value*n3Factor)/(n3MaxValue-n3MinValue); } if (horizN3) { - needle3Target = (value*n3Factor-n3MinValue)/(n3MaxValue-n3MinValue); + needle3Target = (value*n3Factor)/(n3MaxValue-n3MinValue); } if (vertN3) { - needle3Target = (value*n3Factor-n3MinValue)/(n3MaxValue-n3MinValue); + needle3Target = (value*n3Factor)/(n3MaxValue-n3MinValue); } if (!dialTimer.isActive()) dialTimer.start(); diff --git a/ground/openpilotgcs/src/plugins/ipconnection/ipconnection.pri b/ground/openpilotgcs/src/plugins/ipconnection/ipconnection.pri index fc15b3efc..74f3f4380 100644 --- a/ground/openpilotgcs/src/plugins/ipconnection/ipconnection.pri +++ b/ground/openpilotgcs/src/plugins/ipconnection/ipconnection.pri @@ -1,3 +1,3 @@ include(ipconnection_dependencies.pri) -LIBS *= -l$$qtLibraryTarget(IPconnection) +LIBS *= -l$$qtLibraryName(IPconnection) diff --git a/ground/openpilotgcs/src/plugins/logging/loggingplugin.cpp b/ground/openpilotgcs/src/plugins/logging/loggingplugin.cpp index d5e85ccae..6333c4e98 100644 --- a/ground/openpilotgcs/src/plugins/logging/loggingplugin.cpp +++ b/ground/openpilotgcs/src/plugins/logging/loggingplugin.cpp @@ -76,11 +76,10 @@ QIODevice* LoggingConnection::openDevice(const QString &deviceName) if (logFile.isOpen()){ logFile.close(); } - QFileDialog * fd = new QFileDialog(); - fd->setAcceptMode(QFileDialog::AcceptOpen); - fd->setNameFilter("OpenPilot Log (*.opl)"); - connect(fd, SIGNAL(fileSelected(QString)), this, SLOT(startReplay(QString))); - fd->exec(); + QString fileName = QFileDialog::getOpenFileName(NULL, tr("Open file"), QString(""), tr("OpenPilot Log (*.opl)")); + if (!fileName.isNull()) { + startReplay(fileName); + } return &logFile; } diff --git a/ground/openpilotgcs/src/plugins/rawhid/rawhid.pri b/ground/openpilotgcs/src/plugins/rawhid/rawhid.pri index 2761db5be..4982d3408 100644 --- a/ground/openpilotgcs/src/plugins/rawhid/rawhid.pri +++ b/ground/openpilotgcs/src/plugins/rawhid/rawhid.pri @@ -1,3 +1,3 @@ include(rawhid_dependencies.pri) -LIBS *= -l$$qtLibraryTarget(RawHID) +LIBS *= -l$$qtLibraryName(RawHID) diff --git a/ground/openpilotgcs/src/plugins/scope/scope.pri b/ground/openpilotgcs/src/plugins/scope/scope.pri index 99588122d..31dea2f41 100644 --- a/ground/openpilotgcs/src/plugins/scope/scope.pri +++ b/ground/openpilotgcs/src/plugins/scope/scope.pri @@ -1,3 +1,3 @@ -include(scope_dependencies.pri) - -LIBS *= -l$$qtLibraryTarget(ScopeGadget) +include(scope_dependencies.pri) + +LIBS *= -l$$qtLibraryName(ScopeGadget) diff --git a/ground/openpilotgcs/src/plugins/serialconnection/serial.pri b/ground/openpilotgcs/src/plugins/serialconnection/serial.pri index d14f80e74..2b5291336 100644 --- a/ground/openpilotgcs/src/plugins/serialconnection/serial.pri +++ b/ground/openpilotgcs/src/plugins/serialconnection/serial.pri @@ -1,3 +1,3 @@ include(serial_dependencies.pri) -LIBS *= -l$$qtLibraryTarget(Serial) +LIBS *= -l$$qtLibraryName(Serial) diff --git a/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pri b/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pri index a6a378a1d..dbe866573 100644 --- a/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pri +++ b/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pri @@ -1,6 +1,6 @@ -include(uavobjects_dependencies.pri) - -# Add the include path to the built-in uavobject include files. -INCLUDEPATH += $$PWD - -LIBS *= -l$$qtLibraryTarget(UAVObjects) +include(uavobjects_dependencies.pri) + +# Add the include path to the built-in uavobject include files. +INCLUDEPATH += $$PWD + +LIBS *= -l$$qtLibraryName(UAVObjects) diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutil.pri b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutil.pri index fde2f6de0..3890b284a 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutil.pri +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutil.pri @@ -1,6 +1,6 @@ -include(uavobjectutil_dependencies.pri) - -# Add the include path to the built-in uavobject include files. -INCLUDEPATH += $$PWD - -LIBS *= -l$$qtLibraryTarget(UAVObjectUtil) +include(uavobjectutil_dependencies.pri) + +# Add the include path to the built-in uavobject include files. +INCLUDEPATH += $$PWD + +LIBS *= -l$$qtLibraryName(UAVObjectUtil) diff --git a/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.pri b/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.pri index addc16a2a..aeb4173aa 100644 --- a/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.pri +++ b/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.pri @@ -1,3 +1,3 @@ -include(uavtalk_dependencies.pri) - -LIBS *= -l$$qtLibraryTarget(UAVTalk) +include(uavtalk_dependencies.pri) + +LIBS *= -l$$qtLibraryName(UAVTalk) diff --git a/ground/openpilotgcs/src/plugins/welcome/welcome.pri b/ground/openpilotgcs/src/plugins/welcome/welcome.pri index 2edd8a4df..41e3d85b1 100644 --- a/ground/openpilotgcs/src/plugins/welcome/welcome.pri +++ b/ground/openpilotgcs/src/plugins/welcome/welcome.pri @@ -1,3 +1,3 @@ include(welcome_dependencies.pri) -LIBS *= -l$$qtLibraryTarget(Welcome) +LIBS *= -l$$qtLibraryName(Welcome)