moves the registration helper methods for io related extensions into extension_io.cpp

This commit is contained in:
Aaron Seigo 2011-05-27 11:35:14 +02:00
parent 6924341329
commit c02557ffa6
2 changed files with 16 additions and 16 deletions

View File

@ -123,4 +123,20 @@ QScriptValue ScriptEnv::userDataPath(QScriptContext *context, QScriptEngine *eng
return QString();
}
void ScriptEnv::registerGetUrl(QScriptValue &obj)
{
QScriptValue get = obj.property("getUrl");
if (!get.isValid()) {
obj.setProperty("getUrl", m_engine->newFunction(ScriptEnv::getUrl));
}
}
void ScriptEnv::registerOpenUrl(QScriptValue &obj)
{
QScriptValue value = obj.property("openUrl");
if (!value.isValid()) {
obj.setProperty("openUrl", m_engine->newFunction(ScriptEnv::openUrl));
}
}

View File

@ -153,22 +153,6 @@ bool ScriptEnv::checkForErrors(bool fatal)
return false;
}
void ScriptEnv::registerGetUrl(QScriptValue &obj)
{
QScriptValue get = obj.property("getUrl");
if (!get.isValid()) {
obj.setProperty("getUrl", m_engine->newFunction(ScriptEnv::getUrl));
}
}
void ScriptEnv::registerOpenUrl(QScriptValue &obj)
{
QScriptValue value = obj.property("openUrl");
if (!value.isValid()) {
obj.setProperty("openUrl", m_engine->newFunction(ScriptEnv::openUrl));
}
}
bool ScriptEnv::importBuiltinExtension(const QString &extension, QScriptValue &obj)
{
kDebug() << extension;