Added mime type to the showImage method.
This commit is contained in:
parent
fdb0b22ee4
commit
e525492bc6
3 changed files with 5 additions and 4 deletions
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Reference in a new issue