QScriptValue ScriptEngine::extractZip(const QString &zipName, const QString &targetDir) { if (safeScripts) { warn("extract(zipName, targetDir)", "Safe scripts is on."); return ""; } Zip zip; if (!zip.open(zipName)) { return myengine.undefinedValue(); } zip.extractTo(targetDir); return targetDir; }
QScriptValue ScriptEngine:: extractZip(const QString &zipName) { if (safeScripts) { warn("extractZip(zipName)", "Safe scripts is on."); return ""; } Zip zip; if (!zip.open(zipName)) { return myengine.undefinedValue(); } QDir directory; QString current=directory.currentPath(); zip.extractTo(current); return zipName; }