storm-1831 Converting LLSyntaxIdLSL to a singleton. Adding callback for signalling arrival of Syntax file from capability.
parent
acc71d628d
commit
5067f1eed9
|
|
@ -91,6 +91,8 @@ void fetchKeywordsFileResponder::result(const LLSD& content_ref)
|
|||
LL_ERRS("SyntaxLSL")
|
||||
<< "Syntax file '" << mFileSpec << "' contains invalid LLSD!" << LL_ENDL;
|
||||
}
|
||||
|
||||
LLSyntaxIdLSL::sFileFetchedSignal();
|
||||
}
|
||||
|
||||
void fetchKeywordsFileResponder::cacheFile(const LLSD& content_ref)
|
||||
|
|
@ -108,7 +110,6 @@ void fetchKeywordsFileResponder::cacheFile(const LLSD& content_ref)
|
|||
<< "Syntax file received, saving as: '" << mFileSpec << "'" << LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLSyntaxIdLSL
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -121,6 +122,7 @@ LLSD LLSyntaxIdLSL::sKeywordsXml;
|
|||
bool LLSyntaxIdLSL::sLoaded;
|
||||
bool LLSyntaxIdLSL::sLoadFailed;
|
||||
bool LLSyntaxIdLSL::sVersionChanged;
|
||||
LLSyntaxIdLSL::file_fetched_signal_t LLSyntaxIdLSL::sFileFetchedSignal;
|
||||
|
||||
/**
|
||||
* @brief LLSyntaxIdLSL constructor
|
||||
|
|
@ -251,6 +253,7 @@ void LLSyntaxIdLSL::fetchKeywordsFile()
|
|||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// initialise
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -413,3 +416,13 @@ void LLSyntaxIdLSL::loadKeywordsIntoLLSD()
|
|||
}
|
||||
sLoadFailed = !sLoaded;
|
||||
}
|
||||
|
||||
boost::signals2::connection LLSyntaxIdLSL::addFileFetchedCallback(const file_fetched_signal_t::slot_type& cb)
|
||||
{
|
||||
return sFileFetchedSignal.connect(cb);
|
||||
}
|
||||
|
||||
void LLSyntaxIdLSL::removeFileFetchedCallback(boost::signals2::connection callback)
|
||||
{
|
||||
sFileFetchedSignal.disconnect(callback);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<LLSyntaxIdLSL>
|
||||
{
|
||||
friend class fetchKeywordsFileResponder;
|
||||
public:
|
||||
typedef boost::signals2::signal<void()> 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);
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue