From: Flavio Tordini Date: Mon, 3 Aug 2015 12:19:12 +0000 (+0200) Subject: Create data dir if missing X-Git-Tag: 2.5~60 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b73aea7f83ca005e68826659f1c62b5e2f2b13a3;p=minitube Create data dir if missing --- diff --git a/src/jsfunctions.cpp b/src/jsfunctions.cpp index a65c844..67077ef 100644 --- a/src/jsfunctions.cpp +++ b/src/jsfunctions.cpp @@ -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();