summaryrefslogtreecommitdiff
path: root/network/valknut/dcoptions.patch
diff options
context:
space:
mode:
authorKevin Paulus <goarilla@gmail.com>2014-12-07 00:32:51 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-12-07 00:49:28 +0700
commit50da1beac18895c493f44554b475aa00942cf631 (patch)
tree8e30de5de134bf7ae94a75a3f83b696535111361 /network/valknut/dcoptions.patch
parent2ca4eeb064a1b0cb81e83c05eef8792fc0a49924 (diff)
downloadslackbuilds-50da1beac18895c493f44554b475aa00942cf631.tar.gz
network/valknut: Added patch.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/valknut/dcoptions.patch')
-rw-r--r--network/valknut/dcoptions.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/network/valknut/dcoptions.patch b/network/valknut/dcoptions.patch
new file mode 100644
index 0000000000..1d218cc2ed
--- /dev/null
+++ b/network/valknut/dcoptions.patch
@@ -0,0 +1,55 @@
+--- valknut/dcoptions.cpp.orig 2014-12-02 20:28:59.039798842 +0100
++++ valknut/dcoptions.cpp 2014-12-02 22:25:06.352312671 +0100
+@@ -808,15 +808,18 @@
+ {
+ PushButton_GETINTERNETIP->setEnabled(false);
+
+- QHttpRequestHeader header( "GET", "/ip.php" );
+- header.setValue( "Host", "wxdcgui.sourceforge.net" );
++ //QHttpRequestHeader header( "GET", "/ip.php" );
++ QHttpRequestHeader header( "GET", "/" );
++ //header.setValue( "Host", "wxdcgui.sourceforge.net" );
++ header.setValue( "Host", "www.myip.se" );
+ QString useragent = QString("Valknut/") + PACKAGE_VERSION;
+ //printf("User-Agent=%s\n", useragent.toAscii().constData());
+ header.setValue( "User-Agent", useragent );
+
+ m_pHttp = new QHttp();
+ connect( m_pHttp, SIGNAL(done(bool)), this, SLOT(slotGotInternetIP(bool)) );
+- m_pHttp->setHost( "wxdcgui.sourceforge.net" );
++ //m_pHttp->setHost( "wxdcgui.sourceforge.net" );
++ m_pHttp->setHost( "www.myip.se" );
+ m_pHttp->request( header );
+ }
+
+@@ -834,20 +837,25 @@
+ else
+ {
+ QString html = QString(m_pHttp->readAll());
+- int start = html.indexOf("&lt;ip&gt;");
+- int end = html.indexOf("&lt;/ip&gt;",start);
+-
++
++ int start = html.indexOf("<b>");
++ // We need the 2nd "bold" (<b>) attribute
++ start = html.indexOf("<b>",start+3);
++ int end = html.indexOf("</b>",start);
++
+ if ( ( start == -1 ) || ( end < start ) )
+ {
+ QMessageBox::warning(
+ this,
+ tr("Get Internet IP"),
+- tr("Unexpected response from ") + "http://wxdcgui.sourceforge.net"
++ tr("Unexpected response from ") + "http://www.myip.se"
++ // tr("Unexpected response from ") + "http://wxdcgui.sourceforge.net"
+ );
+ }
+ else
+ {
+- start += 10;
++ //start += 10; // wxgui.sourceforge.net
++ start += 21; // www.myip.se
+ QString ip = html.mid( start, end - start );
+
+ if ( QHostAddress().setAddress(ip) )