Ignore:
Timestamp:
Mar 16, 2012, 4:02:47 PM (13 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: 0.7.1 trunk update

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/findsubtitles/simplehttp.cpp

    r119 r124  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2011 Ricardo Villalba <rvm@escomposlinux.org>
     2    Copyright (C) 2006-2012 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    3535
    3636void SimpleHttp::download(const QString & url) {
     37        qDebug("SimpleHttp::download: %s", url.toLatin1().constData());
     38
    3739        downloaded_text.clear();
    3840
    3941        QUrl u(url);
    4042        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        }
    4260
    4361        emit connecting(u.host());
     
    7391        downloaded_text += readAll();
    7492
    75         if (!downloaded_text.isEmpty()) {
     93        //qDebug("downloaded_text: '%s'", downloaded_text.constData());
     94
     95        if ((!error) && (!downloaded_text.isEmpty())) {
    7696                emit downloadFinished(downloaded_text);
    7797        }
Note: See TracChangeset for help on using the changeset viewer.