]> git.sur5r.net Git - minitube/commitdiff
Create data dir if missing
authorFlavio Tordini <flavio.tordini@gmail.com>
Mon, 3 Aug 2015 12:19:12 +0000 (14:19 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Mon, 3 Aug 2015 12:19:12 +0000 (14:19 +0200)
src/jsfunctions.cpp

index a65c844d7e2d8c7c3747978a3293533a7ff5f784..67077ef720c83212b7c59213cbc2300fc15adee5 100644 (file)
@@ -85,6 +85,10 @@ void JsFunctions::gotJs(const QByteArray &bytes) {
         qWarning() << "Got empty js";
         return;
     }
+    if (!QDir().mkpath(Paths::getDataLocation())) {
+      qCritical() << "Failed to create" << Paths::getDataLocation();
+      return;
+    }
     QFile file(jsPath());
     if (!file.open(QIODevice::WriteOnly)) {
         qWarning() << "Cannot write" << file.errorString() << file.fileName();