From 3e9707569ffaa6e3bfb3249fa92ed9ab4710fb26 Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 1 Feb 2009 17:28:43 +0000 Subject: [PATCH] minor updates git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@256 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- src/domquery.cpp | 11 +++++++++++ src/domquery.h | 6 ++++++ src/smoke.pro | 2 +- wob/magicsmoke.wolf | 1 - woc/processor.cpp | 4 ++-- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/domquery.cpp b/src/domquery.cpp index 967f7bb..056fc2d 100644 --- a/src/domquery.cpp +++ b/src/domquery.cpp @@ -12,8 +12,19 @@ #include "domquery.h" + +MDomQuery::MDomQuery(const QDomDocument&start,QString path) +{ + construct(start.documentElement(),path); +} + MDomQuery::MDomQuery(const QDomElement&start,QString path) { + construct(start,path); +} + +void MDomQuery::construct(const QDomElement&start,QString path) +{ //split query QStringList ql=path.split("/",QString::SkipEmptyParts); //determine start mode and initialize list diff --git a/src/domquery.h b/src/domquery.h index 482af21..b3ab7d3 100644 --- a/src/domquery.h +++ b/src/domquery.h @@ -65,6 +65,9 @@ class MDomQuery /**creates the query object and executes the query*/ MDomQuery(const QDomElement&start,QString path); + /**creates the query object and executes the query; this is equivalent to calling the query with the document element as starting point*/ + MDomQuery(const QDomDocument&start,QString path); + /**returns the search result as a single string, if there were multiple matches, they are separated by spaces*/ QString toString()const; /**returns the search result as a list of strings, one string element per match*/ @@ -80,6 +83,9 @@ class MDomQuery operator MDomNodeList()const{return m_result;} private: MDomNodeList m_result; + + //helper for constructor + void construct(const QDomElement&start,QString path); }; #endif diff --git a/src/smoke.pro b/src/smoke.pro index b05c470..27f8108 100644 --- a/src/smoke.pro +++ b/src/smoke.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = msmoke +TARGET = ../src/msmoke #build for debug or release? #CONFIG += release diff --git a/wob/magicsmoke.wolf b/wob/magicsmoke.wolf index 151ff08..4073733 100644 --- a/wob/magicsmoke.wolf +++ b/wob/magicsmoke.wolf @@ -9,7 +9,6 @@ - diff --git a/woc/processor.cpp b/woc/processor.cpp index e6e5742..c1caa05 100644 --- a/woc/processor.cpp +++ b/woc/processor.cpp @@ -143,7 +143,7 @@ void WocProcessor::callSvn() return; } //parse it. - QStringList rl=MDomQuery(doc.documentElement(),"/*/entry/@revision"); + QStringList rl=MDomQuery(doc,"/*/entry/@revision"); if(rl.size()==0){ m_svnRev="unknown"; }else{ @@ -174,7 +174,7 @@ void WocProcessor::callSvn() m_svnRev+=" uncertain"; return; } - QStringList rl=MDomQuery(doc.documentElement(),"/status/target/entry/wc-status/@item"); + QStringList rl=MDomQuery(doc,"/status/target/entry/wc-status/@item"); bool ismod=false; for(int i=0;i