mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
Change API to take an odfcontainerid instead of a callback which does not work.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "odf.h"
|
||||
#include "odfcontainer.h"
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtWebKit/QWebFrame>
|
||||
|
||||
OdfContainer* Odf::getContainer(const QString& url) {
|
||||
return new OdfContainer(url, this);
|
||||
@@ -15,9 +16,14 @@ Odf::addFile(const QString& containerid, const QString& path)
|
||||
}
|
||||
|
||||
QString
|
||||
Odf::load(QString containerid, QString path, QVariant callback)
|
||||
Odf::load(QString containerid, QString path, QString odfcontainerid)
|
||||
{
|
||||
OdfContainer* c = openfiles.value(containerid);
|
||||
if (!c) return QString();
|
||||
return c->loadAsString(path);
|
||||
QString result;
|
||||
if (c) {
|
||||
result = c->loadAsString(path);
|
||||
}
|
||||
// TODO: call the callback with escaped result data
|
||||
// frame->evaluateJavaScript("window.qtodf."+odfcontainerid+".callback("+result+");")
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user