mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Factor out protol string as a constant
This commit is contained in:
parent
6132b7a96c
commit
fe314869c1
@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace GlobalConstants
|
namespace GlobalConstants
|
||||||
{
|
{
|
||||||
|
const std::string PROTOCOL_PREFIX = "gogdownloader://";
|
||||||
|
|
||||||
// Language constants
|
// Language constants
|
||||||
const unsigned int LANGUAGE_EN = 1 << 0;
|
const unsigned int LANGUAGE_EN = 1 << 0;
|
||||||
const unsigned int LANGUAGE_DE = 1 << 1;
|
const unsigned int LANGUAGE_DE = 1 << 1;
|
||||||
|
@ -374,11 +374,10 @@ std::vector<std::string> Util::getDLCNamesFromJSON(const Json::Value &root)
|
|||||||
for (unsigned int i = 0; i < urls.size(); ++i)
|
for (unsigned int i = 0; i < urls.size(); ++i)
|
||||||
{
|
{
|
||||||
std::string gamename;
|
std::string gamename;
|
||||||
std::string match_string = "gogdownloader://";
|
if (urls[i].find(GlobalConstants::PROTOCOL_PREFIX) == std::string::npos)
|
||||||
if (urls[i].find(match_string) == std::string::npos)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
gamename.assign(urls[i].begin()+urls[i].find(match_string)+match_string.length(), urls[i].begin()+urls[i].find_last_of("/"));
|
gamename.assign(urls[i].begin()+urls[i].find(GlobalConstants::PROTOCOL_PREFIX)+GlobalConstants::PROTOCOL_PREFIX.length(), urls[i].begin()+urls[i].find_last_of("/"));
|
||||||
bool bDuplicate = false;
|
bool bDuplicate = false;
|
||||||
for (unsigned int j = 0; j < dlcnames.size(); ++j)
|
for (unsigned int j = 0; j < dlcnames.size(); ++j)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user