Commit 25e6f36e authored by Volker Krause's avatar Volker Krause

Move document opening to ApplicationController

For Android we have to route this through a FileProvider, which requires
C++ code.
parent 41b007fa
......@@ -52,7 +52,7 @@ Kirigami.ScrollablePage {
Kirigami.Action {
iconName: "document-open"
text: i18n("Open Document")
onTriggered: Qt.openUrlExternally(model.filePath);
onTriggered: ApplicationController.openDocument(model.filePath);
},
Kirigami.Action {
iconName: "edit-delete"
......
......@@ -31,6 +31,7 @@
#include <QBuffer>
#include <QClipboard>
#include <QDebug>
#include <QDesktopServices>
#include <QFile>
#include <QGuiApplication>
#include <QJsonArray>
......@@ -488,3 +489,8 @@ void ApplicationController::removeDocument(const QString &batchId, const QString
}
m_docMgr->removeDocument(docId);
}
void ApplicationController::openDocument(const QUrl &url)
{
QDesktopServices::openUrl(url);
}
......@@ -68,6 +68,7 @@ public:
// document attaching
Q_INVOKABLE void addDocument(const QString &batchId);
Q_INVOKABLE void removeDocument(const QString &batchId, const QString &docId);
Q_INVOKABLE void openDocument(const QUrl &url);
Q_SIGNALS:
void clipboardContentChanged();
......
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