[tor-commits] [vidalia/alpha] Make PluginPath follow the path convention

chiiph at torproject.org chiiph at torproject.org
Wed May 30 02:01:55 UTC 2012


commit 1648525c7adca264857cd2d919168244fa51b29f
Author: Tomás Touceda <chiiph at torproject.org>
Date:   Sun May 20 15:43:37 2012 -0300

    Make PluginPath follow the path convention
---
 src/vidalia/plugin/PluginEngine.cpp |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/vidalia/plugin/PluginEngine.cpp b/src/vidalia/plugin/PluginEngine.cpp
index a263753..097ed1e 100644
--- a/src/vidalia/plugin/PluginEngine.cpp
+++ b/src/vidalia/plugin/PluginEngine.cpp
@@ -39,7 +39,12 @@ PluginEngine::PluginEngine(QObject *parent)
   globalObject().setProperty("sleep", newFunction(sleep));
 
   VidaliaSettings settings;
-  globalObject().setProperty("pluginPath", QScriptValue(settings.pluginPath()));
+  QDir path(settings.pluginPath());
+  if(path.isRelative()) {
+    path.setPath(QApplication::applicationDirPath() + "/" + settings.pluginPath());
+  }
+
+  globalObject().setProperty("pluginPath", QScriptValue(path.canonicalPath()));
 
   DebugDialog::outputDebug("Available extensions:");
   foreach(QString ext, availableExtensions())
@@ -58,9 +63,12 @@ PluginEngine::loadAllPlugins()
   DebugDialog::outputDebug("Loading all plugins...");
 
   VidaliaSettings settings;
-  QDir path = QDir(settings.pluginPath());
+  QDir path(settings.pluginPath());
+  if(path.isRelative()) {
+    path.setPath(QApplication::applicationDirPath() + "/" + settings.pluginPath());
+  }
 
-  DebugDialog::outputDebug(QString("PluginPath=%1").arg(path.absolutePath()));
+  DebugDialog::outputDebug(QString("PluginPath=%1").arg(path.canonicalPath()));
 
   foreach(QString pdir, path.entryList(QDir::NoDotAndDotDot|QDir::AllDirs)) {
     QFileInfo finfo(QString("%1%2%3")





More information about the tor-commits mailing list