GH-1020 use plain strings for library URLs
Because the URLs can contain {}, which are percent encoded in URLs and this breaks variable substitution
This commit is contained in:
parent
84757f485b
commit
ff64b6cf1d
@ -228,7 +228,7 @@ void OneSixUpdate::jarlibStart()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString raw_storage = lib->storageSuffix();
|
QString raw_storage = lib->storageSuffix();
|
||||||
QString raw_dl = lib->url().toString();
|
QString raw_dl = lib->url();
|
||||||
|
|
||||||
auto f = [&](QString storage, QString dl)
|
auto f = [&](QString storage, QString dl)
|
||||||
{
|
{
|
||||||
|
@ -157,7 +157,7 @@ QJsonObject RawLibrary::toJson() const
|
|||||||
m_base_url != "https://" + URLConstants::AWS_DOWNLOAD_LIBRARIES &&
|
m_base_url != "https://" + URLConstants::AWS_DOWNLOAD_LIBRARIES &&
|
||||||
m_base_url != "https://" + URLConstants::LIBRARY_BASE && !m_base_url.isEmpty())
|
m_base_url != "https://" + URLConstants::LIBRARY_BASE && !m_base_url.isEmpty())
|
||||||
{
|
{
|
||||||
libRoot.insert("url", m_base_url.toString());
|
libRoot.insert("url", m_base_url);
|
||||||
}
|
}
|
||||||
if (isNative())
|
if (isNative())
|
||||||
{
|
{
|
||||||
@ -224,7 +224,7 @@ bool RawLibrary::filesExist(const QDir &base) const
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
QUrl RawLibrary::url() const
|
QString RawLibrary::url() const
|
||||||
{
|
{
|
||||||
if (!m_absolute_url.isEmpty())
|
if (!m_absolute_url.isEmpty())
|
||||||
{
|
{
|
||||||
@ -236,7 +236,14 @@ QUrl RawLibrary::url() const
|
|||||||
return QString("https://" + URLConstants::LIBRARY_BASE) + storageSuffix();
|
return QString("https://" + URLConstants::LIBRARY_BASE) + storageSuffix();
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_base_url.resolved(storageSuffix());
|
if(m_base_url.endsWith('/'))
|
||||||
|
{
|
||||||
|
return m_base_url + storageSuffix();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return m_base_url + QChar('/') + storageSuffix();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RawLibrary::isActive() const
|
bool RawLibrary::isActive() const
|
||||||
|
@ -86,7 +86,7 @@ public: /* methods */
|
|||||||
QString storagePath() const;
|
QString storagePath() const;
|
||||||
|
|
||||||
/// Set the url base for downloads
|
/// Set the url base for downloads
|
||||||
void setBaseUrl(const QUrl &base_url)
|
void setBaseUrl(const QString &base_url)
|
||||||
{
|
{
|
||||||
m_base_url = base_url;
|
m_base_url = base_url;
|
||||||
}
|
}
|
||||||
@ -127,7 +127,7 @@ public: /* methods */
|
|||||||
bool isActive() const;
|
bool isActive() const;
|
||||||
|
|
||||||
/// Get the URL to download the library from
|
/// Get the URL to download the library from
|
||||||
QUrl url() const;
|
QString url() const;
|
||||||
|
|
||||||
protected: /* data */
|
protected: /* data */
|
||||||
/// the basic gradle dependency specifier.
|
/// the basic gradle dependency specifier.
|
||||||
@ -141,7 +141,7 @@ protected: /* data */
|
|||||||
public: /* data */
|
public: /* data */
|
||||||
// TODO: make all of these protected, clean up semantics of implicit vs. explicit values.
|
// TODO: make all of these protected, clean up semantics of implicit vs. explicit values.
|
||||||
/// URL where the file can be downloaded
|
/// URL where the file can be downloaded
|
||||||
QUrl m_base_url;
|
QString m_base_url;
|
||||||
|
|
||||||
/// DEPRECATED: absolute URL. takes precedence the normal download URL, if defined
|
/// DEPRECATED: absolute URL. takes precedence the normal download URL, if defined
|
||||||
QString m_absolute_url;
|
QString m_absolute_url;
|
||||||
|
Loading…
Reference in New Issue
Block a user