MCPcopy Create free account
hub / github.com/dfranx/SHADERed / FetchTips

Method FetchTips

src/SHADERed/Objects/WebAPI.cpp:389–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387 delete m_pluginsThread;
388 }
389 void WebAPI::FetchTips(std::function<void(int, int, const std::string&, const std::string&)> onFetch)
390 {
391 Logger::Get().Log("Fetching tips with WebAPI");
392
393 std::string currentVersionPath = Settings::Instance().ConvertPath("info.dat");
394
395 std::ifstream verReader(currentVersionPath);
396 int curVer = 0;
397 if (verReader.is_open()) {
398 verReader >> curVer;
399 verReader.close();
400 }
401
402 if (curVer < WebAPI::InternalVersion)
403 return;
404
405 if (m_tipsThread != nullptr && m_tipsThread->joinable())
406 m_tipsThread->join();
407 delete m_tipsThread;
408 m_tipsThread = new std::thread(getTips, onFetch);
409 }
410 void WebAPI::FetchChangelog(std::function<void(const std::string&)> onFetch)
411 {
412 Logger::Get().Log("Fetching changelog with WebAPI");

Callers 1

m_splashScreenRenderMethod · 0.80

Calls 5

InstanceClass · 0.85
LogMethod · 0.80
ConvertPathMethod · 0.80
is_openMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected