mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 01:04:06 +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();
|
||||
}
|
||||
|
||||
void InfoView::show(const QString& path, bool firstOrChangedOnly) {
|
||||
void InfoView::show(const QString& path, bool firstOrChangedOnly, QString urlQuery) {
|
||||
static bool registered{ false };
|
||||
if (!registered) {
|
||||
registerType();
|
||||
|
@ -49,6 +49,8 @@ void InfoView::show(const QString& path, bool firstOrChangedOnly) {
|
|||
} else {
|
||||
url = QUrl::fromLocalFile(path);
|
||||
}
|
||||
url.setQuery(urlQuery);
|
||||
|
||||
if (firstOrChangedOnly) {
|
||||
const QString lastVersion = infoVersion.get();
|
||||
const QString version = fetchVersion(url);
|
||||
|
|
|
@ -22,7 +22,7 @@ class InfoView : public QQuickItem {
|
|||
static const QString NAME;
|
||||
public:
|
||||
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);
|
||||
QUrl url();
|
||||
|
|
Loading…
Reference in a new issue