From 79f72bda47ca995e4f662d02f7b7cf9e49187115 Mon Sep 17 00:00:00 2001 From: edouard Date: Sun, 9 Jan 2011 18:43:03 +0000 Subject: [PATCH] OP-248 Enable serial device polling on Windows too as automatic detection seems to be unreliable. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2354 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../plugins/serialconnection/serialplugin.cpp | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/ground/src/plugins/serialconnection/serialplugin.cpp b/ground/src/plugins/serialconnection/serialplugin.cpp index 0f5ba4aef..33cfd3ea5 100644 --- a/ground/src/plugins/serialconnection/serialplugin.cpp +++ b/ground/src/plugins/serialconnection/serialplugin.cpp @@ -76,19 +76,24 @@ SerialConnection::SerialConnection() : m_enumerateThread(this) { serialHandle = NULL; -#ifdef Q_OS_WIN - //I'm cheating a little bit here: - //Knowing if the device enumeration really changed is a bit complicated - //so I just signal it whenever we have a device event... - QMainWindow *mw = Core::ICore::instance()->mainWindow(); - QObject::connect(mw, SIGNAL(deviceChange()), - this, SLOT(onEnumerationChanged())); -#else + + // Experimental: enable polling on all OS'es since there + // were reports that autodetect does not work on XP amongst + // others. + + //#ifdef Q_OS_WIN +// //I'm cheating a little bit here: +// //Knowing if the device enumeration really changed is a bit complicated +// //so I just signal it whenever we have a device event... +// QMainWindow *mw = Core::ICore::instance()->mainWindow(); +// QObject::connect(mw, SIGNAL(deviceChange()), +// this, SLOT(onEnumerationChanged())); +//#else // Other OSes do not send such signals: QObject::connect(&m_enumerateThread, SIGNAL(enumerationChanged()), this, SLOT(onEnumerationChanged())); m_enumerateThread.start(); -#endif +//#endif } SerialConnection::~SerialConnection()