Skip to content
Snippets Groups Projects

QDS-11912 Project list and run project button are enabled/disabled properly

Merged QDS-11912 Project list and run project button are enabled/disabled properly
Merged Burak Hançerli requested to merge QDS-11912/disable-ui-components-properly into master
4 files
+ 28
21
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 6
8
@@ -150,7 +150,7 @@ void Backend::setAutoScaleProject(const bool &enabled)
@@ -150,7 +150,7 @@ void Backend::setAutoScaleProject(const bool &enabled)
void Backend::setUserHash(const QString &userHash)
void Backend::setUserHash(const QString &userHash)
{
{
QSettings().setValue("user/hash", userHash);
QSettings().setValue("user/hash", userHash);
updateUserProjectList();
emit userRegistered();
}
}
bool Backend::updateInBackground()
bool Backend::updateInBackground()
@@ -494,8 +494,6 @@ void Backend::runOnlineProject(const QString &url)
@@ -494,8 +494,6 @@ void Backend::runOnlineProject(const QString &url)
void Backend::updateUserProjectList()
void Backend::updateUserProjectList()
{
{
emit userRegistered();
const QString userHash = Backend::userHash();
const QString userHash = Backend::userHash();
if (userHash.isEmpty()) {
if (userHash.isEmpty()) {
@@ -511,17 +509,16 @@ void Backend::updateUserProjectList()
@@ -511,17 +509,16 @@ void Backend::updateUserProjectList()
return;
return;
}
}
if (projectList == m_projectListArray) {
if (projectList == m_projectList) {
qDebug("No new projects available");
qDebug("No new projects available");
return;
return;
}
}
m_projectListArray = projectList;
m_projectList.clear();
m_projectList = projectList;
qDebug("List of available projects fetched:");
qDebug("List of available projects fetched:");
for (const auto &project : projectList) {
for (const auto &project : projectList) {
const QString projectName{project.toObject().value("appName").toString()};
const QString projectName{project.toObject().value("appName").toString()};
qDebug() << "--" << projectName;
qDebug() << "--" << projectName;
m_projectList << projectName;
}
}
emit projectListChanged();
emit projectListChanged();
@@ -534,7 +531,7 @@ void Backend::parseDesignViewerUrl(const QUrl &url)
@@ -534,7 +531,7 @@ void Backend::parseDesignViewerUrl(const QUrl &url)
// If it is a user hash, we register the user and fetch the project list
// If it is a user hash, we register the user and fetch the project list
// If it is a project url, we submit the url to the text field
// If it is a project url, we submit the url to the text field
// sample url: https://<url>/<project_name>.qmlrc
// sample url: https://<url>/<project_name>.qmlrc
// sample user hash: qtdesignviewer://17e8907b3b84029384hs8djshdu38476
// sample user hash: qtdesignviewer://19f8907b6t84029384hs8djshdu38476
if (urlData.isEmpty())
if (urlData.isEmpty())
return;
return;
else if (urlData.startsWith("https//")) {
else if (urlData.startsWith("https//")) {
@@ -545,6 +542,7 @@ void Backend::parseDesignViewerUrl(const QUrl &url)
@@ -545,6 +542,7 @@ void Backend::parseDesignViewerUrl(const QUrl &url)
} else if (urlData.startsWith("qtdesignviewer://")) {
} else if (urlData.startsWith("qtdesignviewer://")) {
qDebug() << "Registering user from QR code";
qDebug() << "Registering user from QR code";
setUserHash(url.toString().remove("qtdesignviewer://"));
setUserHash(url.toString().remove("qtdesignviewer://"));
 
updateUserProjectList();
} else {
} else {
qWarning() << "Unknown QR code data: " << urlData;
qWarning() << "Unknown QR code data: " << urlData;
}
}
Loading