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
01b7ae8a
Commit
01b7ae8a
authored
11 years ago
by
Ima Mechanique
Browse files
Options
Downloads
Patches
Plain Diff
Changing how state of loading is reported to better allow other classes to know what is happening.
parent
5551e8f0
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/llsyntaxid.cpp
+24
-21
24 additions, 21 deletions
indra/newview/llsyntaxid.cpp
indra/newview/llsyntaxid.h
+2
-1
2 additions, 1 deletion
indra/newview/llsyntaxid.h
with
26 additions
and
22 deletions
indra/newview/llsyntaxid.cpp
+
24
−
21
View file @
01b7ae8a
...
...
@@ -67,9 +67,10 @@ void fetchKeywordsFileResponder::result(const LLSD& content_ref)
if
(
LLSyntaxIdLSL
::
isSupportedVersion
(
content_ref
))
{
LL_INFOS
(
"SyntaxLSL"
)
<<
"
Is a s
upported verson of syntax file."
<<
LL_ENDL
;
<<
"
S
upported verson of syntax file."
<<
LL_ENDL
;
LLSyntaxIdLSL
::
setKeywordsXml
(
content_ref
);
LLSyntaxIdLSL
::
sInitialised
=
true
;
LLSyntaxIdLSL
::
sLoaded
=
true
;
LLSyntaxIdLSL
::
sLoadFailed
=
false
;
...
...
@@ -115,6 +116,7 @@ const std::string LLSyntaxIdLSL::CAPABILITY_NAME = "LSLSyntax";
const
std
::
string
LLSyntaxIdLSL
::
FILENAME_DEFAULT
=
"keywords_lsl_default.xml"
;
const
std
::
string
LLSyntaxIdLSL
::
SIMULATOR_FEATURE
=
"LSLSyntaxId"
;
bool
LLSyntaxIdLSL
::
sInitialised
;
LLSD
LLSyntaxIdLSL
::
sKeywordsXml
;
bool
LLSyntaxIdLSL
::
sLoaded
;
bool
LLSyntaxIdLSL
::
sLoadFailed
;
...
...
@@ -162,13 +164,14 @@ std::string LLSyntaxIdLSL::buildFullFileSpec()
//-----------------------------------------------------------------------------
bool
LLSyntaxIdLSL
::
checkSyntaxIdChanged
()
{
bool
c
hanged
=
false
;
sVersionC
hanged
=
false
;
LLViewerRegion
*
region
=
gAgent
.
getRegion
();
if
(
region
)
{
if
(
!
region
->
capabilitiesReceived
())
{
// Shouldn't be possible, but experience shows that it may be needed.
sLoadFailed
=
true
;
LL_ERRS
(
"SyntaxLSL"
)
<<
"Region '"
<<
region
->
getName
()
<<
"' has not received capabilities yet! Cannot process SyntaxId."
...
...
@@ -191,7 +194,7 @@ bool LLSyntaxIdLSL::checkSyntaxIdChanged()
<<
"It has LSLSyntaxId capability, and the new hash is '"
<<
mSyntaxIdNew
.
asString
()
<<
"'"
<<
LL_ENDL
;
c
hanged
=
true
;
sVersionC
hanged
=
true
;
}
else
{
...
...
@@ -202,7 +205,7 @@ bool LLSyntaxIdLSL::checkSyntaxIdChanged()
}
else
{
if
(
mSyntaxIdCurrent
.
isNull
()
)
if
(
mSyntaxIdCurrent
.
isNull
()
&&
isInitialised
()
)
{
LL_INFOS
(
"SyntaxLSL"
)
<<
"It does not have LSLSyntaxId capability, remaining with default keywords file!"
...
...
@@ -215,13 +218,12 @@ bool LLSyntaxIdLSL::checkSyntaxIdChanged()
LL_INFOS
(
"SyntaxLSL"
)
<<
"It does not have LSLSyntaxId capability, using default keywords file!"
<<
LL_ENDL
;
c
hanged
=
true
;
sVersionC
hanged
=
true
;
}
}
}
}
sVersionChanged
=
changed
;
return
changed
;
return
sVersionChanged
;
}
/**
...
...
@@ -231,7 +233,7 @@ bool LLSyntaxIdLSL::checkSyntaxIdChanged()
*/
bool
LLSyntaxIdLSL
::
fetching
()
{
return
(
!
sLoaded
&&
!
sLoadFailed
);
return
!
(
sLoaded
||
sLoadFailed
);
}
//-----------------------------------------------------------------------------
...
...
@@ -256,11 +258,17 @@ void LLSyntaxIdLSL::initialise()
{
mFileNameNew
=
mFileNameCurrent
;
mSyntaxIdNew
=
mSyntaxIdCurrent
;
if
(
checkSyntaxIdChanged
())
{
sKeywordsXml
=
LLSD
();
sLoaded
=
sLoadFailed
=
false
;
if
(
!
mCapabilityURL
.
empty
())
if
(
mSyntaxIdNew
.
isNull
())
{
// Need to open the default
loadDefaultKeywordsIntoLLSD
();
}
else
if
(
!
mCapabilityURL
.
empty
()
)
{
LL_INFOS
(
"SyntaxLSL"
)
<<
"LSL version has changed, getting appropriate file."
...
...
@@ -295,17 +303,11 @@ void LLSyntaxIdLSL::initialise()
sLoadFailed
=
true
;
LL_ERRS
(
"SyntaxLSL"
)
<<
"LSLSyntaxId capability URL is empty!!"
<<
LL_ENDL
;
loadDefaultKeywordsIntoLLSD
();
}
}
else
if
(
sKeywordsXml
.
isDefin
ed
())
else
if
(
!
isInitialis
ed
())
{
LL_INFOS
(
"SyntaxLSL"
)
<<
"No change to Syntax! Nothing to see. Move along now!"
<<
LL_ENDL
;
}
else
{
// Need to open the default
loadDefaultKeywordsIntoLLSD
();
}
...
...
@@ -320,7 +322,7 @@ bool LLSyntaxIdLSL::isSupportedVersion(const LLSD& content)
{
bool
isValid
=
false
;
/*
* If the schema used to store
lsl
keywords and hints changes, this value is incremented
* If the schema used to store
LSL
keywords and hints changes, this value is incremented
* Note that it should _not_ be changed if the keywords and hints _content_ changes.
*/
const
U32
LLSD_SYNTAX_LSL_VERSION_EXPECTED
=
2
;
...
...
@@ -392,13 +394,14 @@ void LLSyntaxIdLSL::loadKeywordsIntoLLSD()
if
(
isSupportedVersion
(
content
))
{
sKeywordsXml
=
content
;
sLoaded
=
true
;
sInitialised
=
true
;
LL_INFOS
(
"SyntaxLSL"
)
<<
"Deserialised file: "
<<
mFullFileSpec
<<
LL_ENDL
;
}
else
{
LLSyntaxIdLSL
::
sLoaded
=
false
;
LLSyntaxIdLSL
::
sLoadFailed
=
true
;
sLoaded
=
false
;
LL_WARNS
(
"SyntaxLSL"
)
<<
"Unknown or unsupported version of syntax file."
<<
LL_ENDL
;
}
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llsyntaxid.h
+
2
−
1
View file @
01b7ae8a
...
...
@@ -54,12 +54,12 @@ static const std::string SIMULATOR_FEATURE;
protected:
//LLViewerRegion* region;
static
bool
sInitialised
;
static
LLSD
sKeywordsXml
;
static
bool
sLoaded
;
static
bool
sLoadFailed
;
static
bool
sVersionChanged
;
private:
std
::
string
mCapabilityName
;
std
::
string
mCapabilityURL
;
...
...
@@ -85,6 +85,7 @@ static const std::string SIMULATOR_FEATURE;
LLSD
getKeywordsXML
()
const
{
return
sKeywordsXml
;
}
LLUUID
getSyntaxId
()
const
{
return
mSyntaxIdCurrent
;
}
bool
isDifferentVersion
()
const
{
return
sVersionChanged
;
}
bool
isInitialised
()
const
{
return
sInitialised
;
}
void
initialise
();
bool
isLoaded
()
{
return
sLoaded
;
}
...
...
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