Commit 1df0c0d5 authored by LM's avatar LM

Windows build adjustments

parent 551701e8
......@@ -405,6 +405,10 @@ win32-g++ {
CONFIG += CONSOLE
OUTPUT += CONSOLE
# The EIGEN library needs this define
# to make the internal min/max functions work
DEFINES += NOMINMAX
INCLUDEPATH += $$BASEDIR/lib/sdl/include \
$$BASEDIR/lib/opal/include #\ #\
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
......
......@@ -9,6 +9,13 @@
#include <initguid.h>
//#include "qextserialport.h"
#include <QRegExp>
#ifdef Q_OS_WIN
#ifndef _MSC_VER
#include <windows.h>
#include <dbt.h>
#include <QtCore/qglobal.h>
#endif
#endif
QextSerialEnumerator::QextSerialEnumerator( )
{
......@@ -193,12 +200,12 @@ bool QextSerialEnumerator::getDeviceDetailsWin( QextPortInfo* portInfo, HDEVINFO
QString hardwareIDs = getDeviceProperty(devInfo, devData, SPDRP_HARDWAREID);
HKEY devKey = SetupDiOpenDevRegKey(devInfo, devData, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ);
QRegExp rx("^COM(\\d+)");
QString fullName(getRegKeyValue(devKey, TEXT("PortName")));
if(fullName.contains(rx)) {
int portnum = rx.cap(1).toInt();
if(portnum > 9) // COM ports greater than 9 need \\.\ prepended
fullName.prepend("\\\\.\\");
QRegExp rx("^COM(\\d+)");
QString fullName(getRegKeyValue(devKey, TEXT("PortName")));
if(fullName.contains(rx)) {
int portnum = rx.cap(1).toInt();
if(portnum > 9) // COM ports greater than 9 need \\.\ prepended
fullName.prepend("\\\\.\\");
}
portInfo->portName = fullName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment