]> git.sur5r.net Git - minitube/commitdiff
Ensure JS reloading for new version
authorFlavio <flavio.tordini@gmail.com>
Thu, 13 Nov 2014 14:48:44 +0000 (15:48 +0100)
committerFlavio <flavio.tordini@gmail.com>
Thu, 13 Nov 2014 14:48:44 +0000 (15:48 +0100)
src/jsfunctions.cpp

index ff7859133976462c1febed05c38a16e4d9e57413..b23098f6a4ea2920f740c7f08dc9d747933d5930 100644 (file)
@@ -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*)));