simple access to file paths in the package

svn path=/trunk/KDE/kdebase/workspace/plasma/scriptengines/javascript/; revision=960161
This commit is contained in:
Aaron J. Seigo 2009-04-28 02:14:26 +00:00
parent f9657ce683
commit 816cddf4cd
2 changed files with 14 additions and 0 deletions

View File

@ -171,8 +171,19 @@ QScriptValue AppletInterface::readConfig(const QString &entry) const
return m_appletScriptEngine->variantToScriptValue(result);
}
QString AppletInterface::file(const QString &fileType)
{
return m_appletScriptEngine->package()->filePath(fileType.toLocal8Bit().constData());
}
QString AppletInterface::file(const QString &fileType, const QString &filePath)
{
return m_appletScriptEngine->package()->filePath(fileType.toLocal8Bit().constData(), filePath);
}
const Plasma::Package *AppletInterface::package() const
{
kDebug() << "woot";
return m_appletScriptEngine->package();
}

View File

@ -145,6 +145,9 @@ enum QtOrientation {
Q_INVOKABLE void writeConfig(const QString &entry, const QVariant &value);
Q_INVOKABLE QString file(const QString &fileType);
Q_INVOKABLE QString file(const QString &fileType, const QString &filePath);
Plasma::DataEngine *dataEngine(const QString &name);
const Plasma::Package *package() const;