Changeset 124 for smplayer/trunk/src/findsubtitles/simplehttp.cpp
- Timestamp:
- Mar 16, 2012, 4:02:47 PM (13 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 121-122
- Property svn:mergeinfo changed
-
smplayer/trunk/src/findsubtitles/simplehttp.cpp
r119 r124 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 1 Ricardo Villalba <rvm@escomposlinux.org>2 Copyright (C) 2006-2012 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 35 35 36 36 void SimpleHttp::download(const QString & url) { 37 qDebug("SimpleHttp::download: %s", url.toLatin1().constData()); 38 37 39 downloaded_text.clear(); 38 40 39 41 QUrl u(url); 40 42 setHost( u.host() ); 41 http_get_id = get( u.path() ); 43 44 /* 45 qDebug("u.path: %s", u.path().toLatin1().constData()); 46 qDebug("u.query: %s", u.encodedQuery().constData()); 47 */ 48 49 QString p = u.path(); 50 if (!u.encodedQuery().isEmpty()) p += "?" + u.encodedQuery(); 51 52 if (user_agent.isEmpty()) { 53 http_get_id = get( p ); 54 } else { 55 QHttpRequestHeader header("GET", p); 56 header.setValue("Host", u.host()); 57 header.setValue("User-Agent", user_agent); 58 http_get_id = request(header); 59 } 42 60 43 61 emit connecting(u.host()); … … 73 91 downloaded_text += readAll(); 74 92 75 if (!downloaded_text.isEmpty()) { 93 //qDebug("downloaded_text: '%s'", downloaded_text.constData()); 94 95 if ((!error) && (!downloaded_text.isEmpty())) { 76 96 emit downloadFinished(downloaded_text); 77 97 }
Note:
See TracChangeset
for help on using the changeset viewer.