Changeset 47:345bc5b1b254 in SMSSender


Ignore:
Timestamp:
Jan 30, 2010 10:40:23 AM (9 years ago)
Author:
Sämy Zehnder <saemy.zehnder@…>
Branch:
3.0
Convert:
svn:3639001d-8e34-449c-bb86-3782b86c4877/branches/3.0@46
Message:
  • Added debug() statements
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • gateways/SwisscomXtraZone/src/business/BCAccount.cpp

    r43 r47  
    1212#include <QSslCertificate>
    1313#include <QSslSocket>
     14#include <QDebug>
    1415
    1516#include <StdExceptions.h>
     
    7677
    7778void BCAccount::doLogin() {
     79    qDebug() << "Starting login";
     80
    7881    QMap<QString, QString> posts;
    7982    posts.insert("isiwebuserid", username());
     
    8992        throw new LoginAccount::ELoginException(LoginAccount::ELoginException::Unknown, "The returned page contains no message field.");
    9093    }
     94
     95    qDebug() << "Finished login";
    9196}
    9297
    9398void BCAccount::doLogout() {
     99    qDebug() << "Starting logout";
     100
    94101    httpHelper_->get(LOGOUT_PAGE);
    95102    httpHelper_->cookieManager()->clearCookies();
     103
     104    qDebug() << "Finished logout";
    96105}
    97106
    98107bool BCAccount::stillLoggedIn() {
    99     return httpHelper_->get(MAIN_PAGE).contains("CobYouthSMSSenden:txtMessage", Qt::CaseInsensitive);
     108    qDebug() << "Starting still-logged-in-check";
     109
     110    bool result = httpHelper_->get(MAIN_PAGE).contains("CobYouthSMSSenden:txtMessage", Qt::CaseInsensitive);
     111
     112    qDebug() << "Ended still-logged-in-check with result " + result;
     113    return result;
    100114}
    101115
     
    127141    rx.setCaseSensitivity(Qt::CaseInsensitive); // Caseinsensitive
    128142
     143    qDebug() << "Parsing main page:";
     144
    129145    BCGateway* gtwy = static_cast<BCGateway*>(gateway());
    130146
     
    134150    }
    135151    gtwy->setAddonText(rx.cap(1));
     152    qDebug() << "  Addon text: " + rx.cap(1);
    136153
    137154    rx.setPattern("<input.*id=\"lblcounter\".*value='(\\d*)'.*/?>");
     
    140157    }
    141158    gtwy->setLongSMSLength(rx.cap(1).toInt() + gtwy->addonText().length());
     159    qDebug() << "  Long SMS lenght: " + rx.cap(1);
    142160
    143161    rx.setPattern("<span.*id=\"CobYouthMMSSMSKonto_lblGuthaben\">(\\d*)</span>");
     
    146164    }
    147165    setFreeSMSCount(rx.cap(1).toInt());
     166    qDebug() << "  Free SMS count: " + rx.cap(1);
    148167}
    149168
    150169void BCAccount::_removeRecipients() {
     170    qDebug() << "Removing recipients";
     171
    151172    QMap<QString, QString> posts;
    152173    posts.insert("CobYouthSMSSenden:RecipientsDG:_ctl2:_ctl0", "");
     
    155176        _doPost(posts);
    156177    }
     178    qDebug() << "Recipients removed";
    157179}
    158180
    159181void BCAccount::_addRecipient(const IContact* recipient) {
     182    qDebug() << "Starting adding recipient " + recipient->number().toString();
     183
    160184    QMap<QString, QString> posts;
    161185    posts.insert("CobYouthSMSSenden:btnAddReceiver", "");
     
    163187
    164188    _doPost(posts);
     189    qDebug() << "Recipient added";
    165190}
    166191
    167192void BCAccount::_sendSMS(const QString& text) {
     193    qDebug() << "Starting sending part of SMS";
     194
    168195    QString txt = text;
    169196    txt.replace("&", "%26");
     
    175202
    176203    _doPost(posts);
     204
     205    qDebug() << "Part of SMS sent";
    177206}
    178207
  • lib/libgateway/src/business/HttpHelper.cpp

    r41 r47  
    119119
    120120    request_.httpRequestId = http_->request(header_, request_.posts.toUtf8()/*, req.buffer*/);
     121    qDebug() << "Started request " + QString::number(request_.httpRequestId) + ": " + request_.method + ": " + url_.path();
    121122
    122123    return request_.httpRequestId;
     
    167168        case 303:                   // See Other
    168169        case 307:                   // Temporary Redirect
     170            qDebug() << "Have to redirect [" + QString::number(request_.httpRequestId) + "]";
     171
    169172            request_.httpRequestId = -1; // To avoid error in httpRequestFinished
    170173            http_->abort();
     
    190193
    191194     if (error) {
    192          qDebug() << http_->errorString();
     195         qDebug() << "Finished request " + QString::number(httpRequestId) + " with an error: " + http_->errorString();
    193196         throw Http::EReadException(http_->errorString()); // TODO: Perhaps this error has to be thrown in the waitForRequest by passing a status value to requestLoop_.exit()
    194197     } else {
     198         qDebug() << "Finished request " + httpRequestId;
    195199         requestResult_ = /*request.buffer.readAll()*/ http_->readAll();
    196200         //qDebug() << requestResult_;
  • smssender.pro

    r45 r47  
    2020    lib/libdatatypes/src \
    2121    lib/libutils/src \
    22         include
     22    include
    2323HEADERS += src/persistence/storage/DAAccountListManager.h \
    2424    src/persistence/storage/DAStorage.h \
Note: See TracChangeset for help on using the changeset viewer.