From ebc9d62f69b57d5a79a91beb563b1aad67afcaca Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 29 Mar 2007 14:12:26 +0000 Subject: [PATCH] - Added a signal in upnp to display an error on GUI when no wan service is detected (still unused) --- INSTALL | 2 +- src/UPnP.cpp | 1 + src/UPnP.h | 17 +++++++---------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/INSTALL b/INSTALL index 60f228ffa..bcf05d696 100644 --- a/INSTALL +++ b/INSTALL @@ -26,7 +26,7 @@ Dependencies: - libcurl -- libupnp (>= 1.2.1) +- libupnp (>= 1.2.1) *OPTIONAL* - python >= 2.3 (previous might work - not tested): needed by search engine. diff --git a/src/UPnP.cpp b/src/UPnP.cpp index 3aa5184e2..f2af521b0 100644 --- a/src/UPnP.cpp +++ b/src/UPnP.cpp @@ -886,6 +886,7 @@ bool CUPnPControlPoint::AddPortMappings( { std::ostringstream msg; if (!WanServiceDetected()) { + emit noWanServiceDetected(); msg << "UPnP Error: " "CUPnPControlPoint::AddPortMapping: " "Wan Service not detected."; diff --git a/src/UPnP.h b/src/UPnP.h index 7445121ba..f5b56b336 100644 --- a/src/UPnP.h +++ b/src/UPnP.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -49,14 +50,6 @@ #include -/** - * Case insensitive std::string comparison - */ -bool stdStringIsEqualCI( - const std::string &s1, - const std::string &s2); - - class CUPnPPortMapping { private: @@ -555,8 +548,9 @@ typedef std::map ServiceMap; typedef std::map PortMappingMap; -class CUPnPControlPoint -{ +class CUPnPControlPoint : public QObject { + Q_OBJECT + private: static CUPnPControlPoint *s_CtrlPoint; // upnp stuff @@ -603,6 +597,9 @@ public: void* Event, void* Cookie); + signals: + void noWanServiceDetected(); + private: void OnEventReceived( const std::string &Sid,