Make Linux and LLExperienceLog play nice. Thanks Liru.
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
#include "lldate.h"
|
#include "lldate.h"
|
||||||
|
|
||||||
|
|
||||||
class LLExperienceLogDispatchHandler : public LLDispatchHandler
|
class LLExperienceLogDispatchHandler final : public LLDispatchHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool operator()(
|
bool operator()(
|
||||||
@@ -225,13 +225,14 @@ LLExperienceLog::~LLExperienceLog()
|
|||||||
|
|
||||||
void LLExperienceLog::eraseExpired()
|
void LLExperienceLog::eraseExpired()
|
||||||
{
|
{
|
||||||
|
const auto& inst(*this); // Fixes Linux
|
||||||
std::vector<std::string> expired;
|
std::vector<std::string> expired;
|
||||||
std::for_each(mEvents.beginMap(), mEvents.endMap(),
|
std::for_each(mEvents.beginMap(), mEvents.endMap(),
|
||||||
[&](const auto& event_pair)
|
[&](const auto& event_pair)
|
||||||
{
|
{
|
||||||
const std::string& date = event_pair.first;
|
const std::string& date = event_pair.first;
|
||||||
if (isExpired(date))
|
if (inst.isExpired(date))
|
||||||
{
|
{
|
||||||
expired.push_back(date);
|
expired.push_back(date);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -242,7 +243,7 @@ void LLExperienceLog::eraseExpired()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LLExperienceLog::isExpired(const std::string& date)
|
bool LLExperienceLog::isExpired(const std::string& date) const
|
||||||
{
|
{
|
||||||
S32 month, day, year = 0;
|
S32 month, day, year = 0;
|
||||||
S32 matched = sscanf(date.c_str(), "%d-%d-%d", &year, &month, &day);
|
S32 matched = sscanf(date.c_str(), "%d-%d-%d", &year, &month, &day);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
static void notify(LLSD& message);
|
static void notify(LLSD& message);
|
||||||
static std::string getFilename();
|
static std::string getFilename();
|
||||||
static std::string getPermissionString(const LLSD& message, const std::string& base);
|
static std::string getPermissionString(const LLSD& message, const std::string& base);
|
||||||
bool isExpired(const std::string& date);
|
bool isExpired(const std::string& date) const;
|
||||||
protected:
|
protected:
|
||||||
void handleExperienceMessage(LLSD& message);
|
void handleExperienceMessage(LLSD& message);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user