24 : QObject(parent), _engine(engine)
31 foreach(QString path,
_files) {
35 if(file.open(QIODevice::ReadOnly)) {
36 QString contents = file.readAll();
37 QScriptSyntaxCheckResult res = QScriptEngine::checkSyntax(contents);
38 if(res.state() == QScriptSyntaxCheckResult::Valid) {
44 .arg(res.errorLineNumber())
45 .arg(res.errorColumnNumber())
46 .arg(res.errorMessage())
51 .arg(
name()).arg(path));
60 QDomDocument info(
"Plugin Info");
62 if(!file.open(QIODevice::ReadOnly)) {
64 .arg(path).arg(
name()));
71 if(!info.setContent(&file,
false, &errMsg, &errLine, &errCol)) {
73 .arg(file.fileName()).arg(
name()));
75 .arg(errLine).arg(errCol).arg(errMsg));
81 QDomElement root = info.documentElement();
83 if(root.tagName() !=
"VidaliaPlugin") {
87 QDomNode n = root.firstChild();
89 QDomElement e = n.toElement();
91 if(e.tagName() ==
"name")
93 else if(e.tagName() ==
"author")
95 else if(e.tagName() ==
"date")
97 else if(e.tagName() ==
"type") {
98 _persistent = (e.attribute(
"persistent",
"false") ==
"true");
99 _gui = (e.attribute(
"gui",
"false") ==
"true");
100 }
else if(e.tagName() ==
"files") {
101 QDomNode froot = e.firstChild();
102 while(!froot.isNull()) {
103 QDomElement fe = froot.toElement();
104 if(fe.tagName() ==
"file")
105 _files << QString(
"%1%2%3").arg(QFileInfo(path).path()).arg(QDir::separator()).arg(fe.text());
106 froot = froot.nextSibling();
108 }
else if(e.tagName() ==
"namespace") {
144 VidaliaTab *tab = qscriptvalue_cast<VidaliaTab *>(
156 if(
_engine->hasUncaughtException()) {
158 .arg(
_engine->uncaughtExceptionLineNumber())
159 .arg(
_engine->uncaughtException().toString()));
161 foreach(QString line,
_engine->uncaughtExceptionBacktrace()) {
190 return tr(
"(untitled)");
stop errmsg connect(const QHostAddress &address, quint16 port)
static void outputDebug(const QString &msg)
static void exceptDebug(const QString &msg)
static void syntaxDebug(const QString &msg)
PluginWrapper(const QString &info_path, PluginEngine *engine, QObject *parent=0)
void processInfo(const QString &path)
QStringList files() const
void pluginTab(VidaliaTab *)