Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Qt UI Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Design Studio
QML Viewer Projects
Qt UI Viewer
Merge requests
!25
"share/git@git.qt.io:tohunger/qt-creator.git" did not exist on "4385130538f9a10087f6fc7945bd2aa03e248053"
QDS-11424
Update user projects automatically
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
QDS-11424
Update user projects automatically
QDS-11424/update-user-projects-automatically
into
master
Overview
0
Commits
2
Pipelines
2
Changes
7
Merged
Burak Hançerli
requested to merge
QDS-11424/update-user-projects-automatically
into
master
1 year ago
Overview
0
Commits
2
Pipelines
2
Changes
7
Expand
This MR brings the following features;
New settings page
A new settings option to fetch the user projects in each 10 seconds
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
4fb5e3ea
2 commits,
1 year ago
7 files
+
188
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
src/backend.cpp
+
58
−
1
Options
@@ -72,7 +72,54 @@ void Backend::initialize()
updateUserProjectList
();
}
qDebug
(
"Initialization complete"
);
// Check if updateInBackground is enabled
updateInBackground
(
settings
.
value
(
"system/updateInBackground"
).
toBool
());
qDebug
()
<<
"Initialization complete"
;
}
void
Backend
::
updateInBackground
(
const
bool
&
enabled
)
{
QSettings
().
setValue
(
"system/updateInBackground"
,
enabled
);
if
(
enabled
)
{
qDebug
()
<<
"Update in background is enabled"
;
m_backgroundTimer
.
setInterval
(
1000
*
10
);
connect
(
&
m_backgroundTimer
,
&
QTimer
::
timeout
,
this
,
[
&
]
{
qDebug
()
<<
"Checking for updates in background"
;
if
(
m_userHash
.
isEmpty
())
return
;
m_serviceConnector
.
reset
(
new
ServiceConnector
);
QJsonArray
projectList
=
m_serviceConnector
->
fetchUserProjectList
(
m_userHash
);
if
(
projectList
.
isEmpty
())
return
;
qDebug
()
<<
"New projects available. Updating project list"
;
updateUserProjectList
();
});
m_backgroundTimer
.
start
();
}
else
{
qDebug
()
<<
"Update in background is disabled"
;
m_backgroundTimer
.
stop
();
}
}
void
Backend
::
cacheDemoProjects
(
const
bool
&
enabled
)
{
QSettings
().
setValue
(
"system/cacheDemoProjects"
,
enabled
);
if
(
enabled
)
{
qDebug
()
<<
"Caching demo projects is enabled"
;
}
else
{
qDebug
()
<<
"Caching demo projects is disabled"
;
}
}
void
Backend
::
cacheUserProjects
(
const
bool
&
enabled
)
{
QSettings
().
setValue
(
"system/cacheUserProjects"
,
enabled
);
if
(
enabled
)
{
qDebug
()
<<
"Caching user projects is enabled"
;
}
else
{
qDebug
()
<<
"Caching user projects is disabled"
;
}
}
void
Backend
::
updatePopup
(
const
QString
&
text
,
bool
indeterminate
)
@@ -322,6 +369,16 @@ void Backend::updateUserProjectList()
m_serviceConnector
.
reset
(
new
ServiceConnector
);
QJsonArray
projectList
=
m_serviceConnector
->
fetchUserProjectList
(
m_userHash
);
if
(
projectList
.
isEmpty
())
{
qCritical
(
"Could not fetch available project list"
);
return
;
}
if
(
projectList
==
m_projectListArray
)
{
qDebug
(
"No new projects available"
);
return
;
}
m_projectListArray
=
projectList
;
m_projectList
.
clear
();
qDebug
(
"List of available projects fetched:"
);
for
(
const
auto
&
project
:
projectList
)
{
Loading