Commit 4cfee50e authored by LM's avatar LM

Fixed last compile issues on Windows 7 / VS2008

parent 1adc836d
......@@ -340,7 +340,8 @@ win32-msvc2008 {
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
LIBS += -L$$BASEDIR/lib/sdl/msvc/lib \
-lSDLmain -lSDL
-lSDLmain -lSDL \
-lsetupapi
exists($$BASEDIR/lib/osg123) {
message("Building support for OSG")
......@@ -403,7 +404,8 @@ win32-g++ {
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
LIBS += -L$$BASEDIR/lib/sdl/win32 \
-lmingw32 -lSDLmain -lSDL -mwindows
-lmingw32 -lSDLmain -lSDL -mwindows \
-lsetupapi
CONFIG += windows
......
......@@ -10,11 +10,13 @@
#include <QtCore/qglobal.h>
#ifdef QEXTSERIALPORT_LIB
# define QEXTSERIALPORT_EXPORT Q_DECL_EXPORT
#else
# define QEXTSERIALPORT_EXPORT Q_DECL_IMPORT
#endif
//#ifdef QEXTSERIALPORT_LIB
//# define QEXTSERIALPORT_EXPORT Q_DECL_EXPORT
//#else
//# define QEXTSERIALPORT_EXPORT Q_DECL_IMPORT
//#endif
#define QEXTSERIALPORT_EXPORT
#include <QString>
#include <QList>
......
......@@ -7,7 +7,7 @@
#include <objbase.h>
#include <initguid.h>
#include "qextserialport.h"
//#include "qextserialport.h"
#include <QRegExp>
QextSerialEnumerator::QextSerialEnumerator( )
......@@ -192,7 +192,16 @@ bool QextSerialEnumerator::getDeviceDetailsWin( QextPortInfo* portInfo, HDEVINFO
portInfo->enumName = getDeviceProperty(devInfo, devData, SPDRP_ENUMERATOR_NAME);
QString hardwareIDs = getDeviceProperty(devInfo, devData, SPDRP_HARDWAREID);
HKEY devKey = SetupDiOpenDevRegKey(devInfo, devData, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ);
portInfo->portName = QextSerialPort::fullPortNameWin( getRegKeyValue(devKey, TEXT("PortName")) );
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;
QRegExp idRx("VID_(\\w+)&PID_(\\w+)");
if( hardwareIDs.toUpper().contains(idRx) )
{
......
......@@ -2,6 +2,8 @@
# Automatically generated by qmake (2.01a) Sa. Apr 2 10:42:30 2011
######################################################################
DEFINES += QSERIALPORT_STATIC
DEPENDPATH += . \
include/QtSerialPort \
src/common \
......
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