[tor-commits] [vidalia/alpha] We don't need includes, that can be done by adding the file in info.xml

chiiph at torproject.org chiiph at torproject.org
Sat Jul 21 19:17:47 UTC 2012


commit f3872536b0109cf9c0be9602d7b70794bdcd7160
Author: Tomás Touceda <chiiph at torproject.org>
Date:   Sat Jul 21 15:49:36 2012 -0300

    We don't need includes, that can be done by adding the file in info.xml
---
 src/vidalia/plugin/PluginEngine.cpp |   50 -----------------------------------
 src/vidalia/plugin/PluginEngine.h   |    2 -
 2 files changed, 0 insertions(+), 52 deletions(-)

diff --git a/src/vidalia/plugin/PluginEngine.cpp b/src/vidalia/plugin/PluginEngine.cpp
index 82f133d..a451942 100644
--- a/src/vidalia/plugin/PluginEngine.cpp
+++ b/src/vidalia/plugin/PluginEngine.cpp
@@ -43,7 +43,6 @@ PluginEngine::PluginEngine(QObject *parent)
   globalObject().setProperty("torrc", newQObject(Vidalia::torrc()));
   globalObject().setProperty("vidaliaApp", newQObject(vApp));
 
-//  globalObject().setProperty("include", newFunction(includeScript));
   globalObject().setProperty("importExtension", newFunction(importExtension));
   globalObject().setProperty("vdebug", newFunction(vdebug));
   globalObject().setProperty("findWidget", newFunction(findWidget));
@@ -140,55 +139,6 @@ PluginEngine::importExtension(QScriptContext *context, QScriptEngine *engine)
     return engine->importExtension(context->argument(0).toString());
 }
 
-//QScriptValue
-//PluginEngine::includeScript(QScriptContext *context, QScriptEngine *engine)
-//{
-//  VidaliaSettings settings;
-//  QString path = settings.pluginPath();
-//  QString importFile = context->argument(0).toString();
-//  QFileInfo importInfo(importFile);
-//  if (importInfo.isRelative()) {
-//      importFile =  path + "/" + importInfo.filePath();
-//  }
-
-//  if (!loadFile(importFile, engine)) {
-//      return context->throwError(QString("Failed to resolve include: %1").arg(importFile));
-//  }
-//  return engine->toScriptValue(true);
-//}
-
-//bool
-//PluginEngine::loadFile(QString fileName, QScriptEngine *engine)
-//{
-//    static QSet<QString> loadedFiles;
-//    QFileInfo fileInfo(fileName);
-//    QString absoluteFileName = fileInfo.absoluteFilePath();
-//    QString absolutePath = fileInfo.absolutePath();
-//    QString canonicalFileName = fileInfo.canonicalFilePath();
-//    if (loadedFiles.contains(canonicalFileName)) {
-//        return true;
-//    }
-//    loadedFiles.insert(canonicalFileName);
-//    QString path = fileInfo.path();
-
-//    QFile file(fileName);
-//    if (file.open(QFile::ReadOnly)) {
-//        QTextStream stream(&file);
-//        QString contents = stream.readAll();
-//        file.close();
-
-//        QScriptValue r = engine->evaluate(contents);
-//        if (engine->hasUncaughtException()) {
-//            QStringList backtrace = engine->uncaughtExceptionBacktrace();
-//            qDebug() << QString("    %1\n%2\n\n").arg(r.toString()).arg(backtrace.join("\n"));
-//            return true;
-//        }
-//    } else {
-//        return false;
-//    }
-//    return true;
-//}
-
 QScriptValue
 PluginEngine::vdebug(QScriptContext *context, QScriptEngine *engine)
 {
diff --git a/src/vidalia/plugin/PluginEngine.h b/src/vidalia/plugin/PluginEngine.h
index dd68eba..c0c5166 100644
--- a/src/vidalia/plugin/PluginEngine.h
+++ b/src/vidalia/plugin/PluginEngine.h
@@ -48,8 +48,6 @@ class PluginEngine : public QScriptEngine {
 
   protected:
     static QScriptValue importExtension(QScriptContext *context, QScriptEngine *engine);
-//    static bool loadFile(QString fileName, QScriptEngine *engine);
-//    static QScriptValue includeScript(QScriptContext *context, QScriptEngine *engine);
     static QScriptValue vdebug(QScriptContext *context, QScriptEngine *engine);
     static QScriptValue findWidget(QScriptContext *context, QScriptEngine *engine);
     static QScriptValue sleep(QScriptContext *context, QScriptEngine *engine);





More information about the tor-commits mailing list