Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
c212695c
Commit
c212695c
authored
14 years ago
by
Andrew A. de Laix
Browse files
Options
Downloads
Patches
Plain Diff
post events for dowload success and error.
parent
8e0e5e0b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/viewer_components/updater/llupdaterservice.cpp
+23
-1
23 additions, 1 deletion
indra/viewer_components/updater/llupdaterservice.cpp
indra/viewer_components/updater/llupdaterservice.h
+10
-0
10 additions, 0 deletions
indra/viewer_components/updater/llupdaterservice.h
with
33 additions
and
1 deletion
indra/viewer_components/updater/llupdaterservice.cpp
+
23
−
1
View file @
c212695c
...
...
@@ -135,7 +135,7 @@ class LLUpdaterServiceImpl :
void
downloadComplete
(
LLSD
const
&
data
);
void
downloadError
(
std
::
string
const
&
message
);
bool
onMainLoop
(
LLSD
const
&
event
);
bool
onMainLoop
(
LLSD
const
&
event
);
private
:
void
restartTimer
(
unsigned
int
seconds
);
...
...
@@ -349,6 +349,13 @@ void LLUpdaterServiceImpl::downloadComplete(LLSD const & data)
// marker file.
llofstream
update_marker
(
update_marker_path
());
LLSDSerialize
::
toPrettyXML
(
data
,
update_marker
);
LLSD
event
;
event
[
"pump"
]
=
LLUpdaterService
::
pumpName
();
LLSD
payload
;
payload
[
"type"
]
=
LLSD
(
LLUpdaterService
::
DOWNLOAD_COMPLETE
);
event
[
"payload"
]
=
payload
;
LLEventPumps
::
instance
().
obtain
(
"mainlooprepeater"
).
post
(
event
);
}
void
LLUpdaterServiceImpl
::
downloadError
(
std
::
string
const
&
message
)
...
...
@@ -362,6 +369,14 @@ void LLUpdaterServiceImpl::downloadError(std::string const & message)
{
restartTimer
(
mCheckPeriod
);
}
LLSD
event
;
event
[
"pump"
]
=
LLUpdaterService
::
pumpName
();
LLSD
payload
;
payload
[
"type"
]
=
LLSD
(
LLUpdaterService
::
DOWNLOAD_ERROR
);
payload
[
"message"
]
=
message
;
event
[
"payload"
]
=
payload
;
LLEventPumps
::
instance
().
obtain
(
"mainlooprepeater"
).
post
(
event
);
}
void
LLUpdaterServiceImpl
::
restartTimer
(
unsigned
int
seconds
)
...
...
@@ -405,6 +420,13 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event)
//-----------------------------------------------------------------------
// Facade interface
std
::
string
const
&
LLUpdaterService
::
pumpName
(
void
)
{
static
std
::
string
name
(
"updater_service"
);
return
name
;
}
LLUpdaterService
::
LLUpdaterService
()
{
if
(
gUpdater
.
expired
())
...
...
This diff is collapsed.
Click to expand it.
indra/viewer_components/updater/llupdaterservice.h
+
10
−
0
View file @
c212695c
...
...
@@ -39,6 +39,16 @@ class LLUpdaterService
public:
UsageError
(
const
std
::
string
&
msg
)
:
std
::
runtime_error
(
msg
)
{}
};
// Name of the event pump through which update events will be delivered.
static
std
::
string
const
&
pumpName
(
void
);
// Type codes for events posted by this service. Stored the event's 'type' element.
enum
UpdateEvent
{
INVALID
,
DOWNLOAD_COMPLETE
,
DOWNLOAD_ERROR
};
LLUpdaterService
();
~
LLUpdaterService
();
...
...
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