mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:38:27 +02:00
Add optional url query to InfoView
This commit is contained in:
parent
e4341d7a02
commit
16d91833e8
2 changed files with 4 additions and 2 deletions
|
@ -37,7 +37,7 @@ QString fetchVersion(const QUrl& url) {
|
||||||
return r.trimmed();
|
return r.trimmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoView::show(const QString& path, bool firstOrChangedOnly) {
|
void InfoView::show(const QString& path, bool firstOrChangedOnly, QString urlQuery) {
|
||||||
static bool registered{ false };
|
static bool registered{ false };
|
||||||
if (!registered) {
|
if (!registered) {
|
||||||
registerType();
|
registerType();
|
||||||
|
@ -49,6 +49,8 @@ void InfoView::show(const QString& path, bool firstOrChangedOnly) {
|
||||||
} else {
|
} else {
|
||||||
url = QUrl::fromLocalFile(path);
|
url = QUrl::fromLocalFile(path);
|
||||||
}
|
}
|
||||||
|
url.setQuery(urlQuery);
|
||||||
|
|
||||||
if (firstOrChangedOnly) {
|
if (firstOrChangedOnly) {
|
||||||
const QString lastVersion = infoVersion.get();
|
const QString lastVersion = infoVersion.get();
|
||||||
const QString version = fetchVersion(url);
|
const QString version = fetchVersion(url);
|
||||||
|
|
|
@ -22,7 +22,7 @@ class InfoView : public QQuickItem {
|
||||||
static const QString NAME;
|
static const QString NAME;
|
||||||
public:
|
public:
|
||||||
static void registerType();
|
static void registerType();
|
||||||
static void show(const QString& path, bool firstOrChangedOnly = false);
|
static void show(const QString& path, bool firstOrChangedOnly = false, QString urlQuery = "");
|
||||||
|
|
||||||
InfoView(QQuickItem* parent = nullptr);
|
InfoView(QQuickItem* parent = nullptr);
|
||||||
QUrl url();
|
QUrl url();
|
||||||
|
|
Loading…
Reference in a new issue