1636 //Google login using fake account (feedback.hedgewars@gmail.com) |
1636 //Google login using fake account (feedback.hedgewars@gmail.com) |
1637 nam = new QNetworkAccessManager(this); |
1637 nam = new QNetworkAccessManager(this); |
1638 connect(nam, SIGNAL(finished(QNetworkReply*)), |
1638 connect(nam, SIGNAL(finished(QNetworkReply*)), |
1639 this, SLOT(finishedSlot(QNetworkReply*))); |
1639 this, SLOT(finishedSlot(QNetworkReply*))); |
1640 |
1640 |
1641 QUrl url(string(string("https://www.google.com/accounts/ClientLogin?" |
1641 QUrl url(QString("https://www.google.com/accounts/ClientLogin?" |
1642 "accountType=GOOGLE&Email=feedback.hedgewars@gmail.com&Passwd=hwfeedback&service=code&source=HedgewarsFoundation-Hedgewars-") |
1642 "accountType=GOOGLE&Email=feedback.hedgewars@gmail.com&Passwd=hwfeedback&service=code&source=HedgewarsFoundation-Hedgewars-") |
1643 + (cVersionString?(*cVersionString):QString("")).toStdString()).c_str()); |
1643 + (cVersionString?(*cVersionString):QString(""))); |
1644 nam->get(QNetworkRequest(url)); |
1644 nam->get(QNetworkRequest(url)); |
1645 |
1645 |
1646 } |
1646 } |
1647 |
1647 |
1648 bool HWForm::CreateIssueXml() |
1648 bool HWForm::CreateIssueXml() |
1688 QMessageBox::warning(this, QMessageBox::tr("Network"), |
1688 QMessageBox::warning(this, QMessageBox::tr("Network"), |
1689 QMessageBox::tr("Error during authentication with www.google.com")); |
1689 QMessageBox::tr("Error during authentication with www.google.com")); |
1690 return; |
1690 return; |
1691 } |
1691 } |
1692 |
1692 |
1693 QByteArray body(issueXml.toStdString().c_str()); |
1693 QByteArray body(issueXml.toUtf8()); |
1694 QNetworkRequest header(QUrl("https://code.google.com/feeds/issues/p/hedgewars/issues/full")); |
1694 QNetworkRequest header(QUrl("https://code.google.com/feeds/issues/p/hedgewars/issues/full")); |
1695 header.setRawHeader("Content-Length", QString::number(issueXml.length()).toAscii()); |
1695 header.setRawHeader("Content-Length", QString::number(issueXml.length()).toAscii()); |
1696 header.setRawHeader("Content-Type", "application/atom+xml"); |
1696 header.setRawHeader("Content-Type", "application/atom+xml"); |
1697 header.setRawHeader("Authorization", string( |
1697 header.setRawHeader("Authorization", QString("GoogleLogin auth=%1").arg(authToken).toUtf8()); |
1698 string("GoogleLogin auth=") + authToken.toStdString()).c_str()); |
|
1699 nam->post(header, body); |
1698 nam->post(header, body); |
1700 |
1699 |
1701 } |
1700 } |
1702 else if (authToken.length() == 0) |
1701 else if (authToken.length() == 0) |
1703 QMessageBox::warning(this, QMessageBox::tr("Network"), |
1702 QMessageBox::warning(this, QMessageBox::tr("Network"), |