diff --git a/scriptengines/javascript/appletinterface.cpp b/scriptengines/javascript/appletinterface.cpp index 63fdaeeeb..eeedb80aa 100644 --- a/scriptengines/javascript/appletinterface.cpp +++ b/scriptengines/javascript/appletinterface.cpp @@ -326,6 +326,11 @@ bool AppletInterface::include(const QString &script) return m_appletScriptEngine->include(path); } +bool AppletInterface::hasExtension(const QString &extension) const +{ + return m_appletScriptEngine->loadedExtensions().contains(extension.toLower()); +} + void AppletInterface::debug(const QString &msg) { kDebug() << msg; diff --git a/scriptengines/javascript/appletinterface.h b/scriptengines/javascript/appletinterface.h index 836855eea..fd730ce7c 100644 --- a/scriptengines/javascript/appletinterface.h +++ b/scriptengines/javascript/appletinterface.h @@ -219,6 +219,7 @@ enum QtScrollBarPolicy { Q_INVOKABLE QString file(const QString &fileType, const QString &filePath); Q_INVOKABLE bool include(const QString &script); + Q_INVOKABLE bool hasExtension(const QString &extension) const; Q_INVOKABLE void debug(const QString &msg);