Skip to content
Snippets Groups Projects
Verified Commit 25c0fae3 authored by Burak Hançerli's avatar Burak Hançerli :headphones:
Browse files

fix: cannot download project directly from designviewer service

parent 61342b07
No related branches found
No related tags found
No related merge requests found
Pipeline #61184 passed
......@@ -29,7 +29,7 @@
#include <QEventLoop>
#include <QFileInfo>
#include <QGuiApplication>>
#include <QGuiApplication>
#include <QMessageBox>
#include <QNetworkReply>
#include <QScrollBar>
......@@ -71,7 +71,7 @@ QSharedPointer<QNetworkReply> DvAndroid::fetchResource(const QString &url)
printLog("Fetching resource from " + url);
QNetworkRequest request(url);
request.setRawHeader("authorization", "test");
request.setRawHeader("Authorization", "test");
QSharedPointer<QNetworkReply> reply(m_nam.get(request));
QObject::connect(reply.data(),
&QNetworkReply::sslErrors,
......@@ -121,12 +121,8 @@ void DvAndroid::setupUi()
});
// configure line edit
m_lineEdit->setText("https://designviewer.qt.io/qmlprojects/d41d8cd98f00b204e9800998ecf8427e/"
"UntitledProject18.qmlrc");
// m_lineEdit->setText(
// "https://designviewer.qt.io/qmlprojects/17e8907b3b84b8206d45be4f551f4e25/TestTwo.qmlrc");
// m_lineEdit->setText("https://designviewer.qt.io/qmlprojects/17e8907b3b84b8206d45be4f551f4e25/"
// "UntitledProject23.qmlrc");
m_lineEdit->setText(
"https://designviewer.qt.io/#17e8907b3b84b8206d45be4f551f4e25/TestTwo.qmlrc");
// configure the button
m_button->setText("Download and run project");
......@@ -180,7 +176,16 @@ void DvAndroid::fetchAndRunProject()
printLog("=========================");
printLog("Fetching a new project...");
auto reply = fetchResource(m_lineEdit->text());
// https://designviewer.qt.io/#17e8907b3b84b8206d45be4f551f4e25/TestTwo.qmlrc
// https://designviewer.qt.io/qmlprojects/17e8907b3b84b8206d45be4f551f4e25/TestTwo.qmlrc
QString projectUrl = m_lineEdit->text();
if (projectUrl.startsWith("https://designviewer.qt.io/#")) {
projectUrl = projectUrl.split("#").at(1);
projectUrl.prepend("https://designviewer.qt.io/qmlprojects/");
}
auto reply = fetchResource(projectUrl);
if (reply->error() != QNetworkReply::NoError) {
printErr("Could not fetch project");
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment