From: Flavio Date: Thu, 13 Nov 2014 14:48:44 +0000 (+0100) Subject: Ensure JS reloading for new version X-Git-Tag: 2.3.1~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ffe73ee15c154261fa6902822b652e11a31c37fc;p=minitube Ensure JS reloading for new version --- diff --git a/src/jsfunctions.cpp b/src/jsfunctions.cpp index ff78591..b23098f 100644 --- a/src/jsfunctions.cpp +++ b/src/jsfunctions.cpp @@ -40,7 +40,7 @@ JsFunctions::JsFunctions(QObject *parent) : QObject(parent), engine(0) { else qWarning() << file.errorString() << file.fileName(); QFileInfo info(file); - if (info.lastModified().toTime_t() < QDateTime::currentDateTime().toTime_t() - 3600) + if (info.lastModified().toTime_t() < QDateTime::currentDateTime().toTime_t() - 1800) loadJs(); } else { QFile resFile(QLatin1String(":/") + jsFilename()); @@ -75,6 +75,7 @@ const QString & JsFunctions::jsPath() { void JsFunctions::loadJs() { QUrl url(QLatin1String(Constants::WEBSITE) + "-ws/" + jsFilename()); + url.addQueryItem("v", Constants::VERSION); NetworkReply* reply = The::http()->get(url); connect(reply, SIGNAL(data(QByteArray)), SLOT(gotJs(QByteArray))); connect(reply, SIGNAL(error(QNetworkReply*)), SLOT(errorJs(QNetworkReply*)));