diff options
Diffstat (limited to 'src/findsubtitles/simplehttp.cpp')
-rw-r--r-- | src/findsubtitles/simplehttp.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/findsubtitles/simplehttp.cpp b/src/findsubtitles/simplehttp.cpp index 8800839..9624519 100644 --- a/src/findsubtitles/simplehttp.cpp +++ b/src/findsubtitles/simplehttp.cpp @@ -1,5 +1,5 @@ /* smplayer, GUI front-end for mplayer. - Copyright (C) 2006-2011 Ricardo Villalba <rvm@escomposlinux.org> + Copyright (C) 2006-2012 Ricardo Villalba <rvm@users.sourceforge.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,11 +34,22 @@ SimpleHttp::~SimpleHttp() { } void SimpleHttp::download(const QString & url) { + qDebug("SimpleHttp::download: %s", url.toLatin1().constData()); + downloaded_text.clear(); QUrl u(url); setHost( u.host() ); - http_get_id = get( u.path() ); + + /* + qDebug("u.path: %s", u.path().toLatin1().constData()); + qDebug("u.query: %s", u.encodedQuery().constData()); + */ + + QString p = u.path(); + if (!u.encodedQuery().isEmpty()) p += "?" + u.encodedQuery(); + + http_get_id = get( p ); emit connecting(u.host()); } @@ -72,7 +83,9 @@ void SimpleHttp::httpRequestFinished(int request_id, bool error) { downloaded_text += readAll(); - if (!downloaded_text.isEmpty()) { + //qDebug("downloaded_text: '%s'", downloaded_text.constData()); + + if ((!error) && (!downloaded_text.isEmpty())) { emit downloadFinished(downloaded_text); } } |