diff --git a/assets/StreamTab.qml b/assets/StreamTab.qml index 9a451d0..e71f3ba 100644 --- a/assets/StreamTab.qml +++ b/assets/StreamTab.qml @@ -119,10 +119,10 @@ NavigationPane { function copyText(text) { _app.copyText(text) } - function showImage(filename) { + function showImage(filename, mtype) { console.log('-- showImage --') console.log(filename) - _app.showImage(filename) + _app.showImage(filename, mtype) } attachedObjects: [ ListScrollStateHandler { diff --git a/src/applicationui.cpp b/src/applicationui.cpp index 7fcd4c7..e1fe9fe 100644 --- a/src/applicationui.cpp +++ b/src/applicationui.cpp @@ -119,7 +119,7 @@ void ApplicationUI::onInvoke(const bb::system::InvokeRequest& request) } } -void ApplicationUI::showImage(const QString& filename) +void ApplicationUI::showImage(const QString& filename, const QString& mtype) { qDebug() << "showImage called!"; bb::system::InvokeManager manager; @@ -128,6 +128,7 @@ void ApplicationUI::showImage(const QString& filename) request.setUri(QUrl::fromLocalFile(filename)); request.setTarget("sys.pictures.card.previewer"); request.setAction("bb.action.VIEW"); + request.setMimeType(mtype); bb::system::InvokeTargetReply *targetReply = manager.invoke(request); manager.setParent(this); diff --git a/src/applicationui.hpp b/src/applicationui.hpp index 4ac4f70..96cfbf8 100644 --- a/src/applicationui.hpp +++ b/src/applicationui.hpp @@ -48,7 +48,7 @@ public: Q_INVOKABLE void setSetting(const QString &key, const QString &value); Q_INVOKABLE QString appversion(); Q_INVOKABLE void copyText(QByteArray text); - Q_INVOKABLE void showImage(const QString &filename); + Q_INVOKABLE void showImage(const QString &filename, const QString &mtype); Q_SIGNALS: void createPost(QByteArray text);