From 95f3ead7102f8218e8b0ef1726f0f9b673fa5a11 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Thu, 2 Feb 2012 15:42:18 -0500 Subject: [PATCH] Remove extraneous local IP checks; let the plugin set the name and don't try to adjust it based on IP. --- src/libtomahawk/network/controlconnection.cpp | 11 +---------- src/libtomahawk/network/servent.cpp | 2 ++ src/sip/zeroconf/tomahawkzeroconf.h | 7 +++++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/libtomahawk/network/controlconnection.cpp b/src/libtomahawk/network/controlconnection.cpp index 016bf7d56..142854f8a 100644 --- a/src/libtomahawk/network/controlconnection.cpp +++ b/src/libtomahawk/network/controlconnection.cpp @@ -123,16 +123,7 @@ ControlConnection::setup() return; } - QString friendlyName; - if ( Servent::isIPWhitelisted( m_sock->peerAddress() ) ) - { - // FIXME TODO blocking DNS lookup if LAN, slow/fails on windows? - QHostInfo i = QHostInfo::fromName( m_sock->peerAddress().toString() ); - if( i.hostName().length() ) - friendlyName = i.hostName(); - } - else - friendlyName = name(); + QString friendlyName = name(); tDebug() << "Detected name:" << name() << friendlyName << m_sock->peerAddress(); diff --git a/src/libtomahawk/network/servent.cpp b/src/libtomahawk/network/servent.cpp index 7cc7c021a..adfe6ec21 100644 --- a/src/libtomahawk/network/servent.cpp +++ b/src/libtomahawk/network/servent.cpp @@ -695,6 +695,8 @@ Servent::claimOffer( ControlConnection* cc, const QString &nodeid, const QString bool Servent::checkACL( const Connection* conn, const QString &nodeid, bool showDialog ) const { + Q_UNUSED( conn ); + Q_UNUSED( showDialog ); tDebug( LOGVERBOSE ) << "Checking ACLs"; ACLSystem* aclSystem = ACLSystem::instance(); diff --git a/src/sip/zeroconf/tomahawkzeroconf.h b/src/sip/zeroconf/tomahawkzeroconf.h index 2eaf6ef10..f875ef1dd 100644 --- a/src/sip/zeroconf/tomahawkzeroconf.h +++ b/src/sip/zeroconf/tomahawkzeroconf.h @@ -55,10 +55,13 @@ signals: public slots: void resolved( QHostInfo i ) { - emit tomahawkHostFound( ip, port, i.hostName(), nid ); + if ( i.hostName().length() ) + emit tomahawkHostFound( ip, port, i.hostName(), nid ); + else + emit tomahawkHostFound( ip, port, "Unknown", nid ); this->deleteLater(); } - + void resolve() { QHostInfo::lookupHost( ip, this, SLOT( resolved( QHostInfo ) ) );