kexi: replace includehints with includes in .ui files. #18

Merged
MicheleC merged 1 commits from feat/includehints into master 2 years ago

@ -1105,9 +1105,9 @@ FormIO::saveWidget(ObjectTreeItem *item, TQDomElement &parent, TQDomDocument &do
void void
FormIO::cleanClipboard(TQDomElement &uiElement) FormIO::cleanClipboard(TQDomElement &uiElement)
{ {
// remove includehints element not needed // remove includes element not needed
if(!uiElement.namedItem("includehints").isNull()) if(!uiElement.namedItem("includes").isNull())
uiElement.removeChild(uiElement.namedItem("includehints")); uiElement.removeChild(uiElement.namedItem("includes"));
// and ensure images and connection are at the end // and ensure images and connection are at the end
if(!uiElement.namedItem("connections").isNull()) if(!uiElement.namedItem("connections").isNull())
uiElement.insertAfter(uiElement.namedItem("connections"), TQDomNode()); uiElement.insertAfter(uiElement.namedItem("connections"), TQDomNode());
@ -1484,13 +1484,13 @@ FormIO::addIncludeFileName(const TQString &include, TQDomDocument &domDoc)
TQDomElement includes; TQDomElement includes;
TQDomElement uiEl = domDoc.namedItem("UI").toElement(); TQDomElement uiEl = domDoc.namedItem("UI").toElement();
if(uiEl.namedItem("includehints").isNull()) if(uiEl.namedItem("includes").isNull())
{ {
includes = domDoc.createElement("includehints"); includes = domDoc.createElement("includes");
uiEl.appendChild(includes); uiEl.appendChild(includes);
} }
else else
includes = uiEl.namedItem("includehints").toElement(); includes = uiEl.namedItem("includes").toElement();
// Check if this include has already been saved, and return if it is the case // Check if this include has already been saved, and return if it is the case
for(TQDomNode n = includes.firstChild(); !n.isNull(); n = n.nextSibling()) for(TQDomNode n = includes.firstChild(); !n.isNull(); n = n.nextSibling())
@ -1499,10 +1499,12 @@ FormIO::addIncludeFileName(const TQString &include, TQDomDocument &domDoc)
return; return;
} }
TQDomElement includeHint = domDoc.createElement("includehint"); TQDomElement includeElement = domDoc.createElement("include");
includes.appendChild(includeHint); includes.appendChild(includeElement);
includeElement.setAttribute("location", "global");
includeElement.setAttribute("impldecl", "in implementation");
TQDomText includeText = domDoc.createTextNode(include); TQDomText includeText = domDoc.createTextNode(include);
includeHint.appendChild(includeText); includeElement.appendChild(includeText);
} }
//////// TQt Designer code: these two functions were copied (and adapted) from TQt Designer for compatibility //////// //////// TQt Designer code: these two functions were copied (and adapted) from TQt Designer for compatibility ////////

@ -204,7 +204,7 @@ class KFORMEDITOR_EXPORT FormIO : public TQObject
static void readChildNodes(ObjectTreeItem *tree, Container *container, static void readChildNodes(ObjectTreeItem *tree, Container *container,
const TQDomElement &el, TQWidget *w); const TQDomElement &el, TQWidget *w);
/*! Adds an include file name to be saved in the "includehints" part of .ui file, /*! Adds an include file name to be saved in the "includes" part of .ui file,
which is needed by uic. */ which is needed by uic. */
static void addIncludeFileName(const TQString &include, TQDomDocument &domDoc); static void addIncludeFileName(const TQString &include, TQDomDocument &domDoc);

Loading…
Cancel
Save