diff options
author | kuzulis <scapig2@yandex.ru> | 2011-11-20 21:23:02 +0400 |
---|---|---|
committer | kuzulis <kuzulis@kuzulis.localdomain> | 2011-11-20 21:23:02 +0400 |
commit | 84470fa8a72a080d335d3a95654b5baa48d8a0fa (patch) | |
tree | 7ad602a7fae41a436836cf111daef1de0def08e6 | |
parent | c96eb5a1870845bf46e59470dc5c7dd567f9971b (diff) | |
download | qtserialport-84470fa8a72a080d335d3a95654b5baa48d8a0fa.tar.gz |
*nix: Preparing for the implementation SerialPortInfo for various
*nix/bsd OS.
-rw-r--r-- | src/serialportinfo_unix.cpp | 6 | ||||
-rw-r--r-- | src/src.pro | 2 | ||||
-rw-r--r-- | tests/guiapp/guiapp.pro | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/serialportinfo_unix.cpp b/src/serialportinfo_unix.cpp index 162855f..9da905a 100644 --- a/src/serialportinfo_unix.cpp +++ b/src/serialportinfo_unix.cpp @@ -17,7 +17,7 @@ # include <linux/serial.h> #endif -#if defined (HAVE_UDEV) && defined (Q_OS_LINUX) +#if defined (Q_OS_LINUX) && defined (HAVE_UDEV) extern "C" { # include <libudev.h> @@ -58,7 +58,7 @@ QList<SerialPortInfo> SerialPortInfo::availablePorts() { QList<SerialPortInfo> ports; -#if defined (HAVE_UDEV) +#if defined (Q_OS_LINUX) && defined (HAVE_UDEV) // With udev scan. struct udev *udev = ::udev_new(); if (udev) { @@ -115,6 +115,8 @@ QList<SerialPortInfo> SerialPortInfo::availablePorts() if (udev) ::udev_unref(udev); +#elif defined (Q_OS_FREEBSD) && defined (HAVE_USB) + // #else // With directory /dev scan. QDir devDir("/dev"); diff --git a/src/src.pro b/src/src.pro index 134b9c7..3870743 100644 --- a/src/src.pro +++ b/src/src.pro @@ -76,7 +76,7 @@ unix:!symbian { LIBS += -framework IOKit -framework CoreFoundation } else { SOURCES += serialportinfo_unix.cpp - contains( DEFINES, HAVE_UDEV ) { + linux*:contains( DEFINES, HAVE_UDEV ) { LIBS += -ludev } } diff --git a/tests/guiapp/guiapp.pro b/tests/guiapp/guiapp.pro index 6ce7708..a610023 100644 --- a/tests/guiapp/guiapp.pro +++ b/tests/guiapp/guiapp.pro @@ -1,8 +1,8 @@ QT += core gui TEMPLATE = app -unix { - !macx:DEFINES += HAVE_UDEV +linux* { + DEFINES += HAVE_UDEV } INCLUDEPATH += \ |