Add optional url query to InfoView

This commit is contained in:
Ryan Huffman 2016-11-01 13:43:32 -07:00
parent e4341d7a02
commit 16d91833e8
2 changed files with 4 additions and 2 deletions

View file

@ -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);

View file

@ -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();