Commit 559157c7 authored by Harald Sitter's avatar Harald Sitter

do not write through XHR, it's broken

parent 54ae9599
......@@ -46,6 +46,18 @@ public slots:
qDebug() << "start";
return job->exec();
}
bool write(const QUrl &target, const QString &data)
{
QFile file(target.toLocalFile());
if (!file.open(QFile::WriteOnly | QFile::Text)) {
qDebug() << "failed to open for writing" << target;
return false;
}
QTextStream out(&file);
out << data << endl;
return true;
}
};
int main(int argc, char *argv[])
......
......@@ -52,17 +52,10 @@ ApplicationWindow {
image.source = png
}
function writeData(path, data) {
var xhr = new XMLHttpRequest;
xhr.open("PUT", path);
xhr.send(data);
}
function write(jsonData) {
console.debug(path)
var xhr = new XMLHttpRequest;
xhr.open("PUT", path + ".json");
xhr.send(jsonData);
Needler.Application.write(path + ".json", jsonData)
// Don't XHR https://bugs.kde.org/show_bug.cgi?id=390328
}
width: 1290
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment