From a0607d45ca12c930b9fb8018243e62aed0e09dc9 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Mon, 21 Oct 2013 22:20:33 +0100 Subject: STORM-1831 Adding the llsyntaxid.* files let were left out of commit 7c74a59eeee4 OOPS --- indra/newview/llsyntaxid.h | 65 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 indra/newview/llsyntaxid.h (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h new file mode 100644 index 0000000000..6e5a97fd31 --- /dev/null +++ b/indra/newview/llsyntaxid.h @@ -0,0 +1,65 @@ + +#ifndef LLSYSNTAXIDLSL_H +#define LLSYSNTAXIDLSL_H + +#endif // LLSYSNTAXIDLSL_H + +#include "llviewerprecompiledheaders.h" + +#include "llagent.h" +#include "llenvmanager.h" +#include "llhttpclient.h" +#include "llviewerregion.h" + + +//class LLKeywords; + + +/** + * @file llsyntaxid.h + * @brief The LLSyntaxIdLSL class + */ +class LLSyntaxIdLSL +{ +public: + /** + * @brief LLSyntaxIdLSL constructor + */ + LLSyntaxIdLSL(); + + LLUUID getSyntaxId() const { return mCurrentSyntaxId; } + + bool checkSyntaxIdChange(); + std::string filenameCurrent() { return mFilenameCurrent; } + ELLPath filenamePath() { return mFilenameLocation; } + void initialise(); + static void setKeywordsXml(LLSD& content) { LLSyntaxIdLSL::mKeywordsXml = content; } + +protected: + std::string buildFilename(LLUUID& SyntaxId); + bool fetchKeywordsFile(); + void openKeywordsFile(); + void setSyntaxId(LLUUID SyntaxId) { mCurrentSyntaxId = SyntaxId; } + void setFilenameCurrent(std::string& name) { mFilenameCurrent = name; } + void setFilenameDefault(std::string& name) { mFilenameDefault = name; } + void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } + +public: + static LLHTTPClient::ResponderPtr mResponder; + + +protected: +// LLKeywords& mKeywords; + LLViewerRegion* mRegion; + +private: + std::string mCapabilityName; + LLUUID mCurrentSyntaxId; + std::string mFilenameCurrent; + std::string mFilenameDefault; + std::string mFilenameFull; + ELLPath mFilenameLocation; + std::string mFilenameSpec; + static LLSD mKeywordsXml; + std::string mSimulatorFeature; +}; -- cgit v1.2.3 From dfa8a78c2895e16a4887786d522a70cae59b081e Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Tue, 22 Oct 2013 22:41:08 +0100 Subject: STORM-1831 Style cleanup/fixes --- indra/newview/llsyntaxid.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 6e5a97fd31..e32fcf209e 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -33,7 +33,7 @@ public: std::string filenameCurrent() { return mFilenameCurrent; } ELLPath filenamePath() { return mFilenameLocation; } void initialise(); - static void setKeywordsXml(LLSD& content) { LLSyntaxIdLSL::mKeywordsXml = content; } + static void setKeywordsXml(const LLSD& content) { LLSyntaxIdLSL::sKeywordsXml = content; } protected: std::string buildFilename(LLUUID& SyntaxId); @@ -60,6 +60,7 @@ private: std::string mFilenameFull; ELLPath mFilenameLocation; std::string mFilenameSpec; - static LLSD mKeywordsXml; std::string mSimulatorFeature; + + static LLSD sKeywordsXml; }; -- cgit v1.2.3 From bad5179f276f6913bfb9a313d25d02d0e883d678 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Fri, 25 Oct 2013 14:42:04 +0100 Subject: storm-1831 Fixing viewer crash and clean up. No idea why storing the region pointer in mRegion causes crashes, when doing it locally in each method doesn't. --- indra/newview/llsyntaxid.h | 63 ++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 33 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index e32fcf209e..f7e3d6896e 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -12,9 +12,6 @@ #include "llviewerregion.h" -//class LLKeywords; - - /** * @file llsyntaxid.h * @brief The LLSyntaxIdLSL class @@ -22,45 +19,45 @@ class LLSyntaxIdLSL { public: - /** - * @brief LLSyntaxIdLSL constructor - */ LLSyntaxIdLSL(); - LLUUID getSyntaxId() const { return mCurrentSyntaxId; } + bool checkSyntaxIdChanged(); + std::string getFileNameCurrent() const { return mFileNameCurrent; } + ELLPath getFilePath() const { return mFilePath; } + LLUUID getSyntaxId() const { return mCurrentSyntaxId; } + + void initialise(); + + static void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; } - bool checkSyntaxIdChange(); - std::string filenameCurrent() { return mFilenameCurrent; } - ELLPath filenamePath() { return mFilenameLocation; } - void initialise(); - static void setKeywordsXml(const LLSD& content) { LLSyntaxIdLSL::sKeywordsXml = content; } protected: - std::string buildFilename(LLUUID& SyntaxId); - bool fetchKeywordsFile(); - void openKeywordsFile(); - void setSyntaxId(LLUUID SyntaxId) { mCurrentSyntaxId = SyntaxId; } - void setFilenameCurrent(std::string& name) { mFilenameCurrent = name; } - void setFilenameDefault(std::string& name) { mFilenameDefault = name; } - void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } + std::string buildFileName(LLUUID& SyntaxId); + bool fetchKeywordsFile(); + void openKeywordsFile(); + void setSyntaxId(LLUUID SyntaxId) { mCurrentSyntaxId = SyntaxId; } + void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } + void setFileNameDefault(std::string& name) { mFileNameDefault = name; } + void setFileNameNew(std::string& name) { mFileNameNew = name; } + void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } -public: - static LLHTTPClient::ResponderPtr mResponder; + +//public: protected: -// LLKeywords& mKeywords; - LLViewerRegion* mRegion; + LLViewerRegion* region; + private: - std::string mCapabilityName; - LLUUID mCurrentSyntaxId; - std::string mFilenameCurrent; - std::string mFilenameDefault; - std::string mFilenameFull; - ELLPath mFilenameLocation; - std::string mFilenameSpec; - std::string mSimulatorFeature; - - static LLSD sKeywordsXml; + std::string mCapabilityName; + LLUUID mCurrentSyntaxId; + std::string mFileNameCurrent; + std::string mFileNameDefault; + std::string mFileNameNew; + ELLPath mFilePath; + std::string mFullFileSpec; + std::string mSimulatorFeature; + + static LLSD sKeywordsXml; }; -- cgit v1.2.3 From 0ce27cfdebfd7722bb51c229abf26a5ee1c11d43 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 7 Nov 2013 18:12:45 +0000 Subject: storm-1831 General cleanup of cruft created during caps experiments ;-) --- indra/newview/llsyntaxid.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index f7e3d6896e..d9f2572863 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -12,6 +12,21 @@ #include "llviewerregion.h" +class fetchKeywordsFileResponder : public LLHTTPClient::Responder +{ +public: + std::string mFileSpec; + + fetchKeywordsFileResponder(std::string filespec); + + void errorWithContent(U32 status, + const std::string& reason, + const LLSD& content); + + void result(const LLSD& content_ref); +}; + + /** * @file llsyntaxid.h * @brief The LLSyntaxIdLSL class @@ -24,7 +39,7 @@ public: bool checkSyntaxIdChanged(); std::string getFileNameCurrent() const { return mFileNameCurrent; } ELLPath getFilePath() const { return mFilePath; } - LLUUID getSyntaxId() const { return mCurrentSyntaxId; } + LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } void initialise(); @@ -32,13 +47,14 @@ public: protected: - std::string buildFileName(LLUUID& SyntaxId); - bool fetchKeywordsFile(); + std::string buildFileNameNew(); + std::string buildFullFileSpec(); + void fetchKeywordsFile(); void openKeywordsFile(); - void setSyntaxId(LLUUID SyntaxId) { mCurrentSyntaxId = SyntaxId; } + void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } void setFileNameDefault(std::string& name) { mFileNameDefault = name; } - void setFileNameNew(std::string& name) { mFileNameNew = name; } + void setFileNameNew(std::string name) { mFileNameNew = name; } void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } @@ -51,13 +67,16 @@ protected: private: std::string mCapabilityName; - LLUUID mCurrentSyntaxId; + std::string mCapabilityURL; std::string mFileNameCurrent; std::string mFileNameDefault; std::string mFileNameNew; ELLPath mFilePath; std::string mFullFileSpec; std::string mSimulatorFeature; + LLUUID mSyntaxIdCurrent; + LLUUID mSyntaxIdNew; static LLSD sKeywordsXml; + }; -- cgit v1.2.3 From 4af21580297dd85727ffdc5d4eee89ad58ead271 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Sat, 9 Nov 2013 11:31:32 +0000 Subject: Adding method to load cached/default syntax file and method to access sKeyWordsXML. --- indra/newview/llsyntaxid.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index d9f2572863..50013a8380 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -39,6 +39,7 @@ public: bool checkSyntaxIdChanged(); std::string getFileNameCurrent() const { return mFileNameCurrent; } ELLPath getFilePath() const { return mFilePath; } + LLSD getKeywordsXML() const { return sKeywordsXml; } LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } void initialise(); @@ -50,7 +51,8 @@ protected: std::string buildFileNameNew(); std::string buildFullFileSpec(); void fetchKeywordsFile(); - void openKeywordsFile(); + //void openKeywordsFile(); + bool loadKeywordsFileIntoLLSD(); void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } void setFileNameDefault(std::string& name) { mFileNameDefault = name; } -- cgit v1.2.3 From 29b2129e1eec0dbbb909422e82766a58f14c5da3 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Sat, 9 Nov 2013 11:32:08 +0000 Subject: Backed out changeset: e82d9467bec8 --- indra/newview/llsyntaxid.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 50013a8380..d9f2572863 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -39,7 +39,6 @@ public: bool checkSyntaxIdChanged(); std::string getFileNameCurrent() const { return mFileNameCurrent; } ELLPath getFilePath() const { return mFilePath; } - LLSD getKeywordsXML() const { return sKeywordsXml; } LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } void initialise(); @@ -51,8 +50,7 @@ protected: std::string buildFileNameNew(); std::string buildFullFileSpec(); void fetchKeywordsFile(); - //void openKeywordsFile(); - bool loadKeywordsFileIntoLLSD(); + void openKeywordsFile(); void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } void setFileNameDefault(std::string& name) { mFileNameDefault = name; } -- cgit v1.2.3 From 3b03ffbd70bff48a747f9f3a45056069724fc42f Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Sat, 9 Nov 2013 11:39:53 +0000 Subject: Changing method openKeywordFile to loadKeywordFileIntoLLSD to load cached/default syntax file and method to access sKeyWordsXML. loadKeywordFileIntoLLSD was taken almost verbatim from LLKeywords::loadIntoLLSD which can be removed later. I know the name is long but I wanted to remember where it came from and why it is how it is. Removed a little cruft also. --- indra/newview/llsyntaxid.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index d9f2572863..50013a8380 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -39,6 +39,7 @@ public: bool checkSyntaxIdChanged(); std::string getFileNameCurrent() const { return mFileNameCurrent; } ELLPath getFilePath() const { return mFilePath; } + LLSD getKeywordsXML() const { return sKeywordsXml; } LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } void initialise(); @@ -50,7 +51,8 @@ protected: std::string buildFileNameNew(); std::string buildFullFileSpec(); void fetchKeywordsFile(); - void openKeywordsFile(); + //void openKeywordsFile(); + bool loadKeywordsFileIntoLLSD(); void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } void setFileNameDefault(std::string& name) { mFileNameDefault = name; } -- cgit v1.2.3 From da0cd7b845028f679e6ce7243715d52481f0c430 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Sun, 10 Nov 2013 17:43:17 +0000 Subject: Adding getter for mFullFileSpec, shortening loadKeywordsFileIntoLLSD to loadKeywordsIntoLLSD. --- indra/newview/llsyntaxid.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 50013a8380..fc875a835f 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -39,6 +39,7 @@ public: bool checkSyntaxIdChanged(); std::string getFileNameCurrent() const { return mFileNameCurrent; } ELLPath getFilePath() const { return mFilePath; } + std::string getFileSpec() const { return mFullFileSpec; } LLSD getKeywordsXML() const { return sKeywordsXml; } LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } @@ -51,8 +52,7 @@ protected: std::string buildFileNameNew(); std::string buildFullFileSpec(); void fetchKeywordsFile(); - //void openKeywordsFile(); - bool loadKeywordsFileIntoLLSD(); + bool loadKeywordsIntoLLSD(); void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } void setFileNameDefault(std::string& name) { mFileNameDefault = name; } -- cgit v1.2.3 From 06ed74f177983e2eb170426712f422253a0b48e7 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Sun, 10 Nov 2013 18:29:22 +0000 Subject: Tidying up llsyntaxid files --- indra/newview/llsyntaxid.h | 60 +++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 25 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index fc875a835f..472e88744f 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -11,28 +11,61 @@ #include "llhttpclient.h" #include "llviewerregion.h" - +/** + * @file llsyntaxid.h + * @brief Handles responses for the LSLSyntax capability's get call. + */ class fetchKeywordsFileResponder : public LLHTTPClient::Responder { public: std::string mFileSpec; + /** + * @brief fetchKeywordsFileResponder + * @param filespec File path and name of where to save the returned data + */ fetchKeywordsFileResponder(std::string filespec); void errorWithContent(U32 status, const std::string& reason, const LLSD& content); + /** + * @brief Saves the returned file to the location provided at instantiation. + * @param content_ref The LSL syntax file for the sim. + */ void result(const LLSD& content_ref); }; /** * @file llsyntaxid.h - * @brief The LLSyntaxIdLSL class + * @brief Tracks the file needed to decorate the current sim's version of LSL. */ class LLSyntaxIdLSL { +public: + + +protected: + LLViewerRegion* region; + + +private: + std::string mCapabilityName; + std::string mCapabilityURL; + std::string mFileNameCurrent; + std::string mFileNameDefault; + std::string mFileNameNew; + ELLPath mFilePath; + std::string mFullFileSpec; + std::string mSimulatorFeature; + LLUUID mSyntaxIdCurrent; + LLUUID mSyntaxIdNew; + + static LLSD sKeywordsXml; + + public: LLSyntaxIdLSL(); @@ -58,27 +91,4 @@ protected: void setFileNameDefault(std::string& name) { mFileNameDefault = name; } void setFileNameNew(std::string name) { mFileNameNew = name; } void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } - - -//public: - - -protected: - LLViewerRegion* region; - - -private: - std::string mCapabilityName; - std::string mCapabilityURL; - std::string mFileNameCurrent; - std::string mFileNameDefault; - std::string mFileNameNew; - ELLPath mFilePath; - std::string mFullFileSpec; - std::string mSimulatorFeature; - LLUUID mSyntaxIdCurrent; - LLUUID mSyntaxIdNew; - - static LLSD sKeywordsXml; - }; -- cgit v1.2.3 From 6b451ffdd6b1c75bd363864e48fbcf9b045dbd67 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 18 Nov 2013 13:50:49 -0500 Subject: add license header --- indra/newview/llsyntaxid.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 472e88744f..a79a19be91 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -1,4 +1,29 @@ - +/** + * @file llagentdata.h + * @brief Contains commonly used agent data + * @author Ima Mechanique + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ #ifndef LLSYSNTAXIDLSL_H #define LLSYSNTAXIDLSL_H -- cgit v1.2.3 From 7e749052ca05024ed2ca4c8a799d7ddaf64191d9 Mon Sep 17 00:00:00 2001 From: "niel@mint-32" Date: Wed, 20 Nov 2013 23:59:37 +0000 Subject: storm-1831 Expanding/fixing copyright header --- indra/newview/llsyntaxid.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index a79a19be91..3a711d7460 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -1,6 +1,7 @@ /** - * @file llagentdata.h - * @brief Contains commonly used agent data + * @file llsyntaxid.h + * @brief Contains methods to access the LSLSyntaxId feature and LSLSyntax capability + * to use the appropriate syntax file for the current region's LSL version. * @author Ima Mechanique * * $LicenseInfo:firstyear=2013&license=viewerlgpl$ -- cgit v1.2.3 From b18c9578b58ed7f98cd162adcecbf9df253263c9 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 19 Dec 2013 04:27:28 +0000 Subject: Fixing loading of default keywords file when nothing has been previously loaded. --- indra/newview/llsyntaxid.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 3a711d7460..b968dd233d 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -111,6 +111,7 @@ protected: std::string buildFileNameNew(); std::string buildFullFileSpec(); void fetchKeywordsFile(); + void loadDefaultKeywordsIntoLLSD(const std::string message); bool loadKeywordsIntoLLSD(); void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } -- cgit v1.2.3 From 861d68e27d0c973179618b41903d164cfbc96f94 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 30 Jan 2014 12:58:28 +0000 Subject: Moved fetchKeywordsFileResponder class to end of file, so that LLSyntaxIdLSL is declared ahead of it for friend status. --- indra/newview/llsyntaxid.h | 57 +++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 26 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index b968dd233d..824454f9a1 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -37,32 +37,6 @@ #include "llhttpclient.h" #include "llviewerregion.h" -/** - * @file llsyntaxid.h - * @brief Handles responses for the LSLSyntax capability's get call. - */ -class fetchKeywordsFileResponder : public LLHTTPClient::Responder -{ -public: - std::string mFileSpec; - - /** - * @brief fetchKeywordsFileResponder - * @param filespec File path and name of where to save the returned data - */ - fetchKeywordsFileResponder(std::string filespec); - - void errorWithContent(U32 status, - const std::string& reason, - const LLSD& content); - - /** - * @brief Saves the returned file to the location provided at instantiation. - * @param content_ref The LSL syntax file for the sim. - */ - void result(const LLSD& content_ref); -}; - /** * @file llsyntaxid.h @@ -70,6 +44,7 @@ public: */ class LLSyntaxIdLSL { +friend class fetchKeywordsFileResponder; public: @@ -90,6 +65,7 @@ private: LLUUID mSyntaxIdNew; static LLSD sKeywordsXml; + static bool sLoaded; public: @@ -103,7 +79,9 @@ public: LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } void initialise(); + bool isLoaded() { return sLoaded; } + static bool isSupportedVersion(const LLSD& content); static void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; } @@ -119,3 +97,30 @@ protected: void setFileNameNew(std::string name) { mFileNameNew = name; } void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } }; + + +/** + * @file llsyntaxid.h + * @brief Handles responses for the LSLSyntax capability's get call. Is a friend of LLSyntaxIdLSL + */ +class fetchKeywordsFileResponder : public LLHTTPClient::Responder +{ +public: + std::string mFileSpec; + + /** + * @brief fetchKeywordsFileResponder + * @param filespec File path and name of where to save the returned data + */ + fetchKeywordsFileResponder(std::string filespec); + + void errorWithContent(U32 status, + const std::string& reason, + const LLSD& content); + + /** + * @brief Saves the returned file to the location provided at instantiation. + * @param content_ref The LSL syntax file for the sim. + */ + void result(const LLSD& content_ref); +}; -- cgit v1.2.3 From 93322ff17609ff4bb4f8f87f0b53783b68515279 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 30 Jan 2014 14:03:34 +0000 Subject: Removing duplication of messages --- indra/newview/llsyntaxid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 824454f9a1..78ea98e3cf 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -89,7 +89,7 @@ protected: std::string buildFileNameNew(); std::string buildFullFileSpec(); void fetchKeywordsFile(); - void loadDefaultKeywordsIntoLLSD(const std::string message); + void loadDefaultKeywordsIntoLLSD(); bool loadKeywordsIntoLLSD(); void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } -- cgit v1.2.3 From 2dc2ce995983bfa87527b4ca94d4f13eb94b5c80 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Fri, 31 Jan 2014 11:44:54 +0000 Subject: strom-1831 Cleaning up a number of issues raised. Adding some constants and member variables. Moving arguments into constructor signature and adding new signature. Breaking saving of file into its own method to separate it from checking the LLSD. Cleaning up severla of the logging messages. Differentiating between successful and failed loads/fetches using sLoaded/sLoadFail. --- indra/newview/llsyntaxid.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 78ea98e3cf..3c27a91ce4 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -47,9 +47,17 @@ class LLSyntaxIdLSL friend class fetchKeywordsFileResponder; public: +static const std::string CAPABILITY_NAME; +static const std::string FILENAME_DEFAULT; +static const std::string SIMULATOR_FEATURE; protected: - LLViewerRegion* region; + //LLViewerRegion* region; + + static LLSD sKeywordsXml; + static bool sLoaded; + static bool sLoadFailed; + static bool sVersionChanged; private: @@ -64,19 +72,19 @@ private: LLUUID mSyntaxIdCurrent; LLUUID mSyntaxIdNew; - static LLSD sKeywordsXml; - static bool sLoaded; - public: LLSyntaxIdLSL(); + LLSyntaxIdLSL(std::string filenameDefault, std::string simulatorFeature, std::string capabilityName); bool checkSyntaxIdChanged(); + bool fetching(); std::string getFileNameCurrent() const { return mFileNameCurrent; } ELLPath getFilePath() const { return mFilePath; } std::string getFileSpec() const { return mFullFileSpec; } LLSD getKeywordsXML() const { return sKeywordsXml; } LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } + bool isDifferentVersion() const { return sVersionChanged; } void initialise(); bool isLoaded() { return sLoaded; } @@ -90,7 +98,7 @@ protected: std::string buildFullFileSpec(); void fetchKeywordsFile(); void loadDefaultKeywordsIntoLLSD(); - bool loadKeywordsIntoLLSD(); + void loadKeywordsIntoLLSD(); void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } void setFileNameDefault(std::string& name) { mFileNameDefault = name; } @@ -118,9 +126,17 @@ public: const std::string& reason, const LLSD& content); + /** + * @brief Checks the returned LLSD for version and stores it in the LLSyntaxIdLSL object. + * @param content_ref The returned LLSD. + */ + void result(const LLSD& content_ref); + /** * @brief Saves the returned file to the location provided at instantiation. + * Could be extended to manage cached entries. * @param content_ref The LSL syntax file for the sim. */ - void result(const LLSD& content_ref); + void cacheFile(const LLSD& content_ref); + }; -- cgit v1.2.3 From 566b10e2250e484b2d3211565d387c3c73864e82 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Wed, 5 Feb 2014 15:27:22 +0000 Subject: Cleaning up a little. Using assigned values for simFeature/Capability name instead of literal values. --- indra/newview/llsyntaxid.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 3c27a91ce4..a24edf7204 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -75,7 +75,7 @@ private: public: LLSyntaxIdLSL(); - LLSyntaxIdLSL(std::string filenameDefault, std::string simulatorFeature, std::string capabilityName); + LLSyntaxIdLSL(std::string filenameDefault, std::string simFeatureName, std::string capabilityName); bool checkSyntaxIdChanged(); bool fetching(); @@ -103,7 +103,7 @@ protected: void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } void setFileNameDefault(std::string& name) { mFileNameDefault = name; } void setFileNameNew(std::string name) { mFileNameNew = name; } - void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } +// void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } }; -- cgit v1.2.3 From 01b7ae8abe7efc101202fea786e97862c44e1d21 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 6 Feb 2014 16:41:07 +0000 Subject: Changing how state of loading is reported to better allow other classes to know what is happening. --- indra/newview/llsyntaxid.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index a24edf7204..226f1f4941 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -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 @@ public: 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; } -- cgit v1.2.3 From 5067f1eed9f00e93bf287bf0fce69c8212a51ff2 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 6 Mar 2014 13:11:48 +0000 Subject: storm-1831 Converting LLSyntaxIdLSL to a singleton. Adding callback for signalling arrival of Syntax file from capability. --- indra/newview/llsyntaxid.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 226f1f4941..1b6903f2a2 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -35,6 +35,7 @@ #include "llagent.h" #include "llenvmanager.h" #include "llhttpclient.h" +#include "llsingleton.h" #include "llviewerregion.h" @@ -42,14 +43,15 @@ * @file llsyntaxid.h * @brief Tracks the file needed to decorate the current sim's version of LSL. */ -class LLSyntaxIdLSL +class LLSyntaxIdLSL: public LLSingleton { friend class fetchKeywordsFileResponder; public: + typedef boost::signals2::signal file_fetched_signal_t; -static const std::string CAPABILITY_NAME; -static const std::string FILENAME_DEFAULT; -static const std::string SIMULATOR_FEATURE; + static const std::string CAPABILITY_NAME; + static const std::string FILENAME_DEFAULT; + static const std::string SIMULATOR_FEATURE; protected: //LLViewerRegion* region; @@ -59,6 +61,7 @@ protected: static bool sLoaded; static bool sLoadFailed; static bool sVersionChanged; + static file_fetched_signal_t sFileFetchedSignal; private: std::string mCapabilityName; @@ -73,6 +76,7 @@ private: LLUUID mSyntaxIdNew; + public: LLSyntaxIdLSL(); LLSyntaxIdLSL(std::string filenameDefault, std::string simFeatureName, std::string capabilityName); @@ -93,6 +97,9 @@ public: static bool isSupportedVersion(const LLSD& content); static void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; } + boost::signals2::connection addFileFetchedCallback(const file_fetched_signal_t::slot_type& cb); + void removeFileFetchedCallback(boost::signals2::connection callback); + protected: std::string buildFileNameNew(); @@ -139,5 +146,4 @@ public: * @param content_ref The LSL syntax file for the sim. */ void cacheFile(const LLSD& content_ref); - }; -- cgit v1.2.3 From 8bc42784122619e3f37afabbc5888821c3430369 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Fri, 28 Mar 2014 17:21:36 +0000 Subject: strom-1831: Cleaning out commented and unused code --- indra/newview/llsyntaxid.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 1b6903f2a2..7d6e120038 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -54,8 +54,6 @@ public: static const std::string SIMULATOR_FEATURE; protected: - //LLViewerRegion* region; - static bool sInitialised; static LLSD sKeywordsXml; static bool sLoaded; @@ -111,7 +109,6 @@ protected: void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } void setFileNameDefault(std::string& name) { mFileNameDefault = name; } void setFileNameNew(std::string name) { mFileNameNew = name; } -// void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } }; -- cgit v1.2.3 From 54c7b96bf19efd28cc7ce81c0864ee7bbb7d6b1d Mon Sep 17 00:00:00 2001 From: Cinder Date: Fri, 18 Apr 2014 22:03:05 -0600 Subject: Fix header guard --- indra/newview/llsyntaxid.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 7d6e120038..1f7e893b38 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -25,10 +25,8 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -#ifndef LLSYSNTAXIDLSL_H -#define LLSYSNTAXIDLSL_H - -#endif // LLSYSNTAXIDLSL_H +#ifndef LL_SYNTAXID_H +#define LL_SYNTAXID_H #include "llviewerprecompiledheaders.h" @@ -144,3 +142,5 @@ public: */ void cacheFile(const LLSD& content_ref); }; + +#endif // LLSYNTAXID_H -- cgit v1.2.3 From e8422e5bed6c593c8a26b533f33103911a1d3da6 Mon Sep 17 00:00:00 2001 From: Cinder Date: Tue, 6 May 2014 11:09:50 -0600 Subject: Let's get started: some code policy cleanup, reference arguments where we can, correct spelling --- indra/newview/llsyntaxid.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 1f7e893b38..75cfc45380 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -75,7 +75,7 @@ private: public: LLSyntaxIdLSL(); - LLSyntaxIdLSL(std::string filenameDefault, std::string simFeatureName, std::string capabilityName); + LLSyntaxIdLSL(const std::string& filename, const std::string& sim_feature, const std::string& capability); bool checkSyntaxIdChanged(); bool fetching(); @@ -104,9 +104,9 @@ protected: void loadDefaultKeywordsIntoLLSD(); void loadKeywordsIntoLLSD(); void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } - void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } - void setFileNameDefault(std::string& name) { mFileNameDefault = name; } - void setFileNameNew(std::string name) { mFileNameNew = name; } + void setFileNameCurrent(const std::string& name) { mFileNameCurrent = name; } + void setFileNameDefault(const std::string& name) { mFileNameDefault = name; } + void setFileNameNew(const std::string name) { mFileNameNew = name; } }; -- cgit v1.2.3 From 8501d6494bceeea962d7251d882ddc244a8daa7f Mon Sep 17 00:00:00 2001 From: Cinder Date: Wed, 7 May 2014 19:58:56 -0600 Subject: Code policy --- indra/newview/llsyntaxid.h | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 75cfc45380..b68f3f4237 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -36,23 +36,18 @@ #include "llsingleton.h" #include "llviewerregion.h" - -/** - * @file llsyntaxid.h - * @brief Tracks the file needed to decorate the current sim's version of LSL. - */ -class LLSyntaxIdLSL: public LLSingleton +class LLSyntaxIdLSL : public LLSingleton { friend class fetchKeywordsFileResponder; public: typedef boost::signals2::signal file_fetched_signal_t; - static const std::string CAPABILITY_NAME; - static const std::string FILENAME_DEFAULT; - static const std::string SIMULATOR_FEATURE; + static const std::string CAPABILITY_NAME; + static const std::string FILENAME_DEFAULT; + static const std::string SIMULATOR_FEATURE; protected: - static bool sInitialised; + static bool sInitialized; static LLSD sKeywordsXml; static bool sLoaded; static bool sLoadFailed; @@ -85,16 +80,15 @@ public: LLSD getKeywordsXML() const { return sKeywordsXml; } LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } bool isDifferentVersion() const { return sVersionChanged; } - bool isInitialised() const { return sInitialised; } + bool isInitialized() const { return sInitialized; } - void initialise(); + void initialize(); bool isLoaded() { return sLoaded; } static bool isSupportedVersion(const LLSD& content); static void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; } boost::signals2::connection addFileFetchedCallback(const file_fetched_signal_t::slot_type& cb); - void removeFileFetchedCallback(boost::signals2::connection callback); protected: @@ -110,10 +104,6 @@ protected: }; -/** - * @file llsyntaxid.h - * @brief Handles responses for the LSLSyntax capability's get call. Is a friend of LLSyntaxIdLSL - */ class fetchKeywordsFileResponder : public LLHTTPClient::Responder { public: -- cgit v1.2.3 From 059a29e976a41c30ec9fb346ae53bbc51aa682fc Mon Sep 17 00:00:00 2001 From: Cinder Date: Sun, 11 May 2014 23:17:31 -0600 Subject: Fix callback signal, Eliminate some unnecessary statics --- indra/newview/llsyntaxid.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index b68f3f4237..179d622286 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -42,17 +42,13 @@ friend class fetchKeywordsFileResponder; public: typedef boost::signals2::signal file_fetched_signal_t; - static const std::string CAPABILITY_NAME; - static const std::string FILENAME_DEFAULT; - static const std::string SIMULATOR_FEATURE; - protected: - static bool sInitialized; - static LLSD sKeywordsXml; - static bool sLoaded; - static bool sLoadFailed; - static bool sVersionChanged; - static file_fetched_signal_t sFileFetchedSignal; + bool sInitialized; + LLSD sKeywordsXml; + bool sLoaded; + bool sLoadFailed; + bool sVersionChanged; + file_fetched_signal_t sFileFetchedSignal; private: std::string mCapabilityName; @@ -85,8 +81,8 @@ public: void initialize(); bool isLoaded() { return sLoaded; } - static bool isSupportedVersion(const LLSD& content); - static void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; } + bool isSupportedVersion(const LLSD& content); + void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; } boost::signals2::connection addFileFetchedCallback(const file_fetched_signal_t::slot_type& cb); -- cgit v1.2.3 From 82cd99d6eb1fbe57e80f54ece6f740c520c7b78a Mon Sep 17 00:00:00 2001 From: Cinder Date: Mon, 12 May 2014 07:49:18 -0600 Subject: Style - rename previously static members, fix scope, ease up on the exclamation points in debug messages --- indra/newview/llsyntaxid.h | 58 +++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 32 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 179d622286..d803a09167 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -39,30 +39,6 @@ class LLSyntaxIdLSL : public LLSingleton { friend class fetchKeywordsFileResponder; -public: - typedef boost::signals2::signal file_fetched_signal_t; - -protected: - bool sInitialized; - LLSD sKeywordsXml; - bool sLoaded; - bool sLoadFailed; - bool sVersionChanged; - file_fetched_signal_t sFileFetchedSignal; - -private: - std::string mCapabilityName; - std::string mCapabilityURL; - std::string mFileNameCurrent; - std::string mFileNameDefault; - std::string mFileNameNew; - ELLPath mFilePath; - std::string mFullFileSpec; - std::string mSimulatorFeature; - LLUUID mSyntaxIdCurrent; - LLUUID mSyntaxIdNew; - - public: LLSyntaxIdLSL(); @@ -73,20 +49,19 @@ public: std::string getFileNameCurrent() const { return mFileNameCurrent; } ELLPath getFilePath() const { return mFilePath; } std::string getFileSpec() const { return mFullFileSpec; } - LLSD getKeywordsXML() const { return sKeywordsXml; } + LLSD getKeywordsXML() const { return mKeywordsXml; } LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } - bool isDifferentVersion() const { return sVersionChanged; } - bool isInitialized() const { return sInitialized; } + bool isDifferentVersion() const { return mVersionChanged; } + bool isInitialized() const { return mInitialized; } void initialize(); - bool isLoaded() { return sLoaded; } - - bool isSupportedVersion(const LLSD& content); - void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; } + bool isLoaded() { return mLoaded; } + bool isSupportedVersion(const LLSD& content); + void setKeywordsXml(const LLSD& content) { mKeywordsXml = content; } + typedef boost::signals2::signal file_fetched_signal_t; boost::signals2::connection addFileFetchedCallback(const file_fetched_signal_t::slot_type& cb); - protected: std::string buildFileNameNew(); std::string buildFullFileSpec(); @@ -97,6 +72,25 @@ protected: void setFileNameCurrent(const std::string& name) { mFileNameCurrent = name; } void setFileNameDefault(const std::string& name) { mFileNameDefault = name; } void setFileNameNew(const std::string name) { mFileNameNew = name; } + +private: + bool mInitialized; + LLSD mKeywordsXml; + bool mLoaded; + bool mLoadFailed; + bool mVersionChanged; + file_fetched_signal_t mFileFetchedSignal; + + std::string mCapabilityName; + std::string mCapabilityURL; + std::string mFileNameCurrent; + std::string mFileNameDefault; + std::string mFileNameNew; + ELLPath mFilePath; + std::string mFullFileSpec; + std::string mSimulatorFeature; + LLUUID mSyntaxIdCurrent; + LLUUID mSyntaxIdNew; }; -- cgit v1.2.3 From 15d8f355072f2184f046a7aafb1b5c606fe97880 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 14 May 2014 16:43:13 -0400 Subject: clean up the constructor for LLSyntaxIdLSL --- indra/newview/llsyntaxid.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index d803a09167..aa69209ca9 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -42,7 +42,6 @@ friend class fetchKeywordsFileResponder; public: LLSyntaxIdLSL(); - LLSyntaxIdLSL(const std::string& filename, const std::string& sim_feature, const std::string& capability); bool checkSyntaxIdChanged(); bool fetching(); @@ -74,6 +73,10 @@ protected: void setFileNameNew(const std::string name) { mFileNameNew = name; } private: + static const std::string CAPABILITY_NAME; + static const std::string FILENAME_DEFAULT; + static const std::string SIMULATOR_FEATURE; + bool mInitialized; LLSD mKeywordsXml; bool mLoaded; -- cgit v1.2.3 From 7ada3ea719e583101ea0762ed75f0c1b803f08dc Mon Sep 17 00:00:00 2001 From: Cinder Date: Wed, 14 May 2014 20:37:25 -0600 Subject: Clean up LLSyntaxIdLSL ctor --- indra/newview/llsyntaxid.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index d803a09167..0f347a6ce3 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -42,7 +42,6 @@ friend class fetchKeywordsFileResponder; public: LLSyntaxIdLSL(); - LLSyntaxIdLSL(const std::string& filename, const std::string& sim_feature, const std::string& capability); bool checkSyntaxIdChanged(); bool fetching(); @@ -70,7 +69,6 @@ protected: void loadKeywordsIntoLLSD(); void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } void setFileNameCurrent(const std::string& name) { mFileNameCurrent = name; } - void setFileNameDefault(const std::string& name) { mFileNameDefault = name; } void setFileNameNew(const std::string name) { mFileNameNew = name; } private: @@ -81,14 +79,11 @@ private: bool mVersionChanged; file_fetched_signal_t mFileFetchedSignal; - std::string mCapabilityName; std::string mCapabilityURL; std::string mFileNameCurrent; - std::string mFileNameDefault; std::string mFileNameNew; ELLPath mFilePath; std::string mFullFileSpec; - std::string mSimulatorFeature; LLUUID mSyntaxIdCurrent; LLUUID mSyntaxIdNew; }; -- cgit v1.2.3 From e6b20328c2e25223359dede17357682b5b4e7ea1 Mon Sep 17 00:00:00 2001 From: Cinder Date: Wed, 4 Jun 2014 22:51:20 -0600 Subject: A little more cleanup in LLSyntaxIDLSL and LLKeywords --- indra/newview/llsyntaxid.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index f14693d619..2288fb4ab8 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -62,8 +62,7 @@ public: boost::signals2::connection addFileFetchedCallback(const file_fetched_signal_t::slot_type& cb); protected: - std::string buildFileNameNew(); - std::string buildFullFileSpec(); + void buildFullFileSpec(); void fetchKeywordsFile(); void loadDefaultKeywordsIntoLLSD(); void loadKeywordsIntoLLSD(); @@ -105,7 +104,7 @@ public: * @brief fetchKeywordsFileResponder * @param filespec File path and name of where to save the returned data */ - fetchKeywordsFileResponder(std::string filespec); + fetchKeywordsFileResponder(const std::string& filespec); void errorWithContent(U32 status, const std::string& reason, -- cgit v1.2.3 From 41f6c5ce4899b3ae57aefa564ee22ff84fa698ce Mon Sep 17 00:00:00 2001 From: Cinder Date: Mon, 9 Jun 2014 15:14:09 -0600 Subject: Greatly simplify LLSyntaxIdLSL: * Move file fetched callback to the singleton and handle all syntax id changes within the singleton * Remove a fair number of bool checks and method relying more on callbacks to drive syntax changes. * Don't pretty print the cache file to conserve space and to speed up xml to llsd parsing * Clean up includes --- indra/newview/llsyntaxid.h | 111 ++++++++++++--------------------------------- 1 file changed, 28 insertions(+), 83 deletions(-) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 2288fb4ab8..70f6b28337 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -2,7 +2,7 @@ * @file llsyntaxid.h * @brief Contains methods to access the LSLSyntaxId feature and LSLSyntax capability * to use the appropriate syntax file for the current region's LSL version. - * @author Ima Mechanique + * @author Ima Mechanique, Cinder Roxley * * $LicenseInfo:firstyear=2013&license=viewerlgpl$ * Second Life Viewer Source Code @@ -30,98 +30,43 @@ #include "llviewerprecompiledheaders.h" -#include "llagent.h" -#include "llenvmanager.h" -#include "llhttpclient.h" #include "llsingleton.h" -#include "llviewerregion.h" + +class fetchKeywordsFileResponder; class LLSyntaxIdLSL : public LLSingleton { -friend class fetchKeywordsFileResponder; - -public: - LLSyntaxIdLSL(); - - bool checkSyntaxIdChanged(); - bool fetching(); - std::string getFileNameCurrent() const { return mFileNameCurrent; } - ELLPath getFilePath() const { return mFilePath; } - std::string getFileSpec() const { return mFullFileSpec; } - LLSD getKeywordsXML() const { return mKeywordsXml; } - LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } - bool isDifferentVersion() const { return mVersionChanged; } - bool isInitialized() const { return mInitialized; } - - void initialize(); - bool isLoaded() { return mLoaded; } - - bool isSupportedVersion(const LLSD& content); - void setKeywordsXml(const LLSD& content) { mKeywordsXml = content; } - typedef boost::signals2::signal file_fetched_signal_t; - boost::signals2::connection addFileFetchedCallback(const file_fetched_signal_t::slot_type& cb); - -protected: - void buildFullFileSpec(); - void fetchKeywordsFile(); - void loadDefaultKeywordsIntoLLSD(); - void loadKeywordsIntoLLSD(); - void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } - void setFileNameCurrent(const std::string& name) { mFileNameCurrent = name; } - void setFileNameNew(const std::string name) { mFileNameNew = name; } + friend class LLSingleton; + friend class fetchKeywordsFileResponder; private: - static const std::string CAPABILITY_NAME; - static const std::string FILENAME_DEFAULT; - static const std::string SIMULATOR_FEATURE; - - bool mInitialized; - LLSD mKeywordsXml; - bool mLoaded; - bool mLoadFailed; - bool mVersionChanged; - file_fetched_signal_t mFileFetchedSignal; + std::list mInflightFetches; + typedef boost::signals2::signal syntax_id_changed_signal_t; + syntax_id_changed_signal_t mSyntaxIDChangedSignal; + boost::signals2::connection mRegionChangedCallback; + + bool syntaxIdChanged(); + bool isSupportedVersion(const LLSD& content); + void handleRegionChanged(); + void handleFileFetched(const std::string& filepath); + void setKeywordsXml(const LLSD& content) { mKeywordsXml = content; }; + void buildFullFileSpec(); + void fetchKeywordsFile(const std::string& filespec); + void loadDefaultKeywordsIntoLLSD(); + void loadKeywordsIntoLLSD(); - std::string mCapabilityName; std::string mCapabilityURL; - std::string mFileNameCurrent; - std::string mFileNameDefault; - std::string mFileNameNew; - ELLPath mFilePath; std::string mFullFileSpec; - std::string mSimulatorFeature; - LLUUID mSyntaxIdCurrent; - LLUUID mSyntaxIdNew; -}; - - -class fetchKeywordsFileResponder : public LLHTTPClient::Responder -{ + ELLPath mFilePath; + LLUUID mSyntaxId; + LLSD mKeywordsXml; + public: - std::string mFileSpec; - - /** - * @brief fetchKeywordsFileResponder - * @param filespec File path and name of where to save the returned data - */ - fetchKeywordsFileResponder(const std::string& filespec); - - void errorWithContent(U32 status, - const std::string& reason, - const LLSD& content); - - /** - * @brief Checks the returned LLSD for version and stores it in the LLSyntaxIdLSL object. - * @param content_ref The returned LLSD. - */ - void result(const LLSD& content_ref); - - /** - * @brief Saves the returned file to the location provided at instantiation. - * Could be extended to manage cached entries. - * @param content_ref The LSL syntax file for the sim. - */ - void cacheFile(const LLSD& content_ref); + LLSyntaxIdLSL(); + void initialize(); + bool keywordFetchInProgress(); + LLSD getKeywordsXML() const { return mKeywordsXml; }; + boost::signals2::connection addSyntaxIDCallback(const syntax_id_changed_signal_t::slot_type& cb); }; #endif // LLSYNTAXID_H -- cgit v1.2.3 From 984353d7ca6184d7252c716150d42139aae94e5c Mon Sep 17 00:00:00 2001 From: Cinder Date: Fri, 20 Jun 2014 11:02:50 -0600 Subject: STORM-2036 - Fix trying to parse caps too early by adding a callback to check region caps when they haven't already been received --- indra/newview/llsyntaxid.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llsyntaxid.h') diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index 70f6b28337..504fb0997e 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -48,6 +48,7 @@ private: bool syntaxIdChanged(); bool isSupportedVersion(const LLSD& content); void handleRegionChanged(); + void handleCapsReceived(const LLUUID& region_uuid); void handleFileFetched(const std::string& filepath); void setKeywordsXml(const LLSD& content) { mKeywordsXml = content; }; void buildFullFileSpec(); -- cgit v1.2.3