diff --git a/src/backend.h b/src/backend.h index 464d5023..b8e077af 100644 --- a/src/backend.h +++ b/src/backend.h @@ -106,7 +106,7 @@ class Backend : public QObject { // Called for org.freedesktop.FileManager1: open a folder, or open the // folder holding a file and select it. void showFolder(const QString &path); - void showItem(const QString &path); + Q_INVOKABLE void showItem(const QString &path); static QString expandTyped(const QString &text, const QString &home, const QString ¤t); static QString complete(const QString &text, const QString &home, const QString ¤t); diff --git a/tests/folio_tests.cpp b/tests/folio_tests.cpp index 42458bd1..4d2cad08 100644 --- a/tests/folio_tests.cpp +++ b/tests/folio_tests.cpp @@ -3315,7 +3315,8 @@ private slots: QTemporaryDir home; write(home.filePath("report.pdf"), "x"); Backend backend(home.path()); - backend.showItem(home.filePath("report.pdf")); + // As QML calls it, through the meta-object system. + QVERIFY(QMetaObject::invokeMethod(&backend, "showItem", Q_ARG(QString, home.filePath("report.pdf")))); QCOMPARE(backend.path(), home.path()); QCOMPARE(backend.takeSelection(), QString("report.pdf")); }