Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shared_code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
molflow_synrad
shared_code
Commits
c6294d0d
Commit
c6294d0d
authored
5 months ago
by
Marton Ady
Browse files
Options
Downloads
Patches
Plain Diff
replace updater fetch status with enum class
parent
4be48653
Branches
Branches containing commit
Tags
molflow_v2.9.27
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Interface/AppUpdater.cpp
+5
-5
5 additions, 5 deletions
Interface/AppUpdater.cpp
Interface/AppUpdater.h
+7
-5
7 additions, 5 deletions
Interface/AppUpdater.h
with
12 additions
and
10 deletions
Interface/AppUpdater.cpp
+
5
−
5
View file @
c6294d0d
...
...
@@ -193,7 +193,7 @@ int AppUpdater::RequestUpdateCheck() {
}
void
AppUpdater
::
NotifyServerWarning
()
{
if
(
lastFetchStatus
==
FetchStatus
::
N
ONE
)
return
;
//didn't perform an update check yet
if
(
lastFetchStatus
==
FetchStatus
::
N
one
)
return
;
//didn't perform an update check yet
if
(
nbUpdateFailsInRow
>=
askAfterNbUpdateFails
)
{
// Issue the warning in a new window
if
(
!
updateWarning
)
{
...
...
@@ -311,20 +311,20 @@ void AppUpdater::PerformUpdateCheck(bool forceCheck) {
//availableUpdates.insert(availableUpdates.end(), availableUpdates_old.begin(), availableUpdates_old.end());
resultCategory
=
"updateCheck"
;
resultDetail
<<
"updateCheck_"
<<
applicationName
<<
"_"
<<
currentVersionId
;
lastFetchStatus
=
FetchStatus
::
OK
AY
;
lastFetchStatus
=
FetchStatus
::
OK
;
}
else
{
//parse error
errorState
=
true
;
resultCategory
=
"parseError"
;
resultDetail
<<
"parseError_"
<<
parseResult
.
status
<<
"_"
<<
applicationName
<<
"_"
<<
currentVersionId
;
lastFetchStatus
=
FetchStatus
::
P
ARSE_ERROR
;
lastFetchStatus
=
FetchStatus
::
P
arseError
;
}
}
else
{
//download error
errorState
=
true
;
resultCategory
=
"stringDownloadError"
;
resultDetail
<<
"stringDownloadError_"
<<
downloadResult
<<
"_"
<<
applicationName
<<
"_"
<<
currentVersionId
;
lastFetchStatus
=
FetchStatus
::
D
OWNLOAD_ERROR
;
lastFetchStatus
=
FetchStatus
::
D
ownloadError
;
}
//Send result for analytics
...
...
@@ -1111,7 +1111,7 @@ void ManualUpdateCheckDialog::Refresh() {
}
else
{
// no updates found at startup, try again now
updater
->
PerformImmediateCheck
();
if
(
updater
->
GetStatus
()
!=
(
int
)
FetchStatus
::
OK
AY
){
if
(
updater
->
GetStatus
()
!=
FetchStatus
::
OK
){
updateError
=
true
;
}
if
(
updater
->
IsUpdateAvailable
())
{
...
...
This diff is collapsed.
Click to expand it.
Interface/AppUpdater.h
+
7
−
5
View file @
c6294d0d
...
...
@@ -193,11 +193,13 @@ private:
UpdateFoundDialog
*
foundWnd
;
};
enum
FetchStatus
enum
class
FetchStatus
{
NONE
=
0
,
DOWNLOAD_ERROR
=
1
,
OTHER_ERROR
=
2
,
OKAY
,
PARSE_ERROR
None
=
0
,
DownloadError
=
1
,
OtherError
=
2
,
OK
,
ParseError
};
class
AppUpdater
{
...
...
@@ -235,7 +237,7 @@ private:
//Initialized by constructor:
int
currentVersionId
;
FetchStatus
lastFetchStatus
=
FetchStatus
::
N
ONE
;
FetchStatus
lastFetchStatus
=
FetchStatus
::
N
one
;
std
::
string
applicationName
;
std
::
string
configFileName
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment