generate docu for privileges
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Fri, 1 Jan 2010 17:02:31 +0000 (17:02 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Fri, 1 Jan 2010 17:02:31 +0000 (17:02 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@390 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

woc/htmlout.cpp
woc/processor.cpp
woc/processor.h

index 50de719..3ef5503 100644 (file)
@@ -372,6 +372,19 @@ void WocHtmlOut::newTransaction(const WocTransaction&trn)
                hcd+="</li>\n";
        }
        hcd+="</ul>\n";
+       //privileges
+       QStringList pri=trn.privileges();
+       if(pri.size()){
+               hcd+="<h2>Privileges</h2>\n<ul>\n";
+               for(int i=0;i<pri.size();i++){
+                       hcd+="<li>"+pri[i];
+                       QString d=trn.privilegeDoc(pri[i]);
+                       if(d!="")
+                               hcd+="<br/>"+d;
+                       hcd+="</li>\n";
+               }
+               hcd+="</ul>\n";
+       }
        hcd+="</body></html>\n";
        htm.write(hcd.toAscii());
 }
index 768e3d9..16f84c8 100644 (file)
@@ -1157,6 +1157,7 @@ WocTransaction::WocTransaction(const QDomElement&root)
        for(int i=0;i<nl.size();i++){
                QString s=nl.at(i).toElement().attribute("name").trimmed();
                if(s!="")m_privileges<<s;
+               m_privdoc.insert(s,nl.at(i).toElement().text().trimmed());
        }
 }
 
index 5435bab..dd32476 100644 (file)
@@ -330,6 +330,9 @@ class WocTransaction
                /**return docu of output element*/
                QString outputDoc(QString v)const
                {if(m_outdoc.contains(v))return m_outdoc[v];else return "";}
+               /**return docu of a privilege*/
+               QString privilegeDoc(QString p)const
+               {if(m_privdoc.contains(p))return m_privdoc[p];else return "";}
                
                /**return privileges that exist inside this transaction*/
                QStringList privileges()const{return m_privileges;}
@@ -342,7 +345,7 @@ class WocTransaction
                QStringList m_privileges;
                //docu
                QStringList m_docstrings;
-               QMap<QString,QString>m_indoc,m_outdoc;
+               QMap<QString,QString>m_indoc,m_outdoc,m_privdoc;
 };
 
 /**base class of all output generators*/