[rkward-cvs] rkward/rkward/plugin rkcomponentmap.cpp,1.9,1.10
Thomas Friedrichsmeier
tfry at users.sourceforge.net
Sun Mar 26 17:26:21 UTC 2006
Update of /cvsroot/rkward/rkward/rkward/plugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20093/rkward/plugin
Modified Files:
rkcomponentmap.cpp
Log Message:
Allow inclusion of .pluginmap files in .pluginmap files
Index: rkcomponentmap.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponentmap.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** rkcomponentmap.cpp 20 Mar 2006 22:13:23 -0000 1.9
--- rkcomponentmap.cpp 26 Mar 2006 17:26:19 -0000 1.10
***************
*** 136,145 ****
if (xml->highestError () >= DL_ERROR) return (0);
! QString prefix = QFileInfo (plugin_map_file).dirPath (true) + "/" + xml->getStringAttribute(document_element, "base_prefix", QString::null, DL_WARNING);
! QString cnamespace = xml->getStringAttribute(document_element, "namespace", "rkward", DL_WARNING) + "::";
// step 1: create (list of) components
! element = xml->getChildElement (document_element, "components", DL_ERROR);
! list = xml->getChildElements (element, "component", DL_ERROR);
for (XMLChildList::const_iterator it=list.begin (); it != list.end (); ++it) {
--- 136,145 ----
if (xml->highestError () >= DL_ERROR) return (0);
! QString prefix = QFileInfo (plugin_map_file).dirPath (true) + "/" + xml->getStringAttribute (document_element, "base_prefix", QString::null, DL_INFO);
! QString cnamespace = xml->getStringAttribute (document_element, "namespace", "rkward", DL_INFO) + "::";
// step 1: create (list of) components
! element = xml->getChildElement (document_element, "components", DL_INFO);
! list = xml->getChildElements (element, "component", DL_INFO);
for (XMLChildList::const_iterator it=list.begin (); it != list.end (); ++it) {
***************
*** 161,166 ****
QDomElement xmlgui_menubar_elem = xml->getChildElement (xmlguiBuildDocument ().documentElement (), "MenuBar", DL_ERROR);
! element = xml->getChildElement (document_element, "hierarchy", DL_ERROR);
! list = xml->getChildElements (element, "menu", DL_ERROR);
int counter = 0;
for (XMLChildList::const_iterator it=list.begin (); it != list.end (); ++it) {
--- 161,166 ----
QDomElement xmlgui_menubar_elem = xml->getChildElement (xmlguiBuildDocument ().documentElement (), "MenuBar", DL_ERROR);
! element = xml->getChildElement (document_element, "hierarchy", DL_INFO);
! list = xml->getChildElements (element, "menu", DL_INFO);
int counter = 0;
for (XMLChildList::const_iterator it=list.begin (); it != list.end (); ++it) {
***************
*** 168,171 ****
--- 168,186 ----
}
+ // step 3: included files
+ QStringList includelist;
+ list = xml->getChildElements (document_element, "include", DL_INFO);
+ for (XMLChildList::const_iterator it=list.constBegin (); it != list.constEnd (); ++it) {
+ QString file = prefix + xml->getStringAttribute (*it, "file", QString::null, DL_ERROR);
+ if (QFileInfo (file).isReadable ()) {
+ includelist.append (file);
+ } else {
+ RK_DO (qDebug ("Specified include file '%s' does not exist or is not readable. Ignoring.", file.latin1 ()), PLUGIN, DL_ERROR);
+ }
+ }
+ for (QStringList::const_iterator it = includelist.constBegin (); it != includelist.constEnd (); ++it) {
+ counter += addPluginMap (*it);
+ }
+
return counter;
}
More information about the rkward-tracker
mailing list