[Changelog]: Re-order urls

This commit is contained in:
FutureRave
2022-11-23 15:31:48 +00:00
parent cab16650b0
commit 9b903f64e4
2 changed files with 25 additions and 27 deletions

View File

@ -7,44 +7,44 @@ namespace Components
void Changelog::LoadChangelog()
{
//if (!Changelog::Lines.empty())
// return;
std::lock_guard _(Mutex);
Lines.clear();
std::lock_guard<std::mutex> _(Changelog::Mutex);
Changelog::Lines.clear();
std::string data = Utils::Cache::GetFile("/develop/CHANGELOG.md");
const auto data = Utils::Cache::GetFile("/develop/CHANGELOG.md");
if (data.empty())
{
data = "^1Unable to get changelog.";
Lines.emplace_back("^1Unable to get changelog.");
return;
}
Changelog::Lines = Utils::String::Split(data, '\n');
for (auto& line : Changelog::Lines)
auto buffer = Utils::String::Split(data, '\n');
for (auto& line : buffer)
{
Utils::String::Replace(line, "\r", "");
}
Lines = buffer;
}
unsigned int Changelog::GetChangelogCount()
{
return Changelog::Lines.size();
return Lines.size();
}
// Omit column here
const char* Changelog::GetChangelogText(unsigned int item, int /*column*/)
const char* Changelog::GetChangelogText(unsigned int item, [[maybe_unused]] int column)
{
std::lock_guard<std::mutex> _(Changelog::Mutex);
if (item < Changelog::Lines.size())
std::lock_guard _(Mutex);
if (item < Lines.size())
{
return Utils::String::VA("%s", Changelog::Lines[item].data());
return Utils::String::VA("%s", Lines[item].data());
}
return "";
}
void Changelog::SelectChangelog(unsigned int /*index*/)
void Changelog::SelectChangelog([[maybe_unused]] unsigned int index)
{
// Don't do anything in here
}