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
FormIO::cleanClipboard(TQDomElement &uiElement)
{
// remove includehints element not needed
if(!uiElement.namedItem("includehints").isNull())
uiElement.removeChild(uiElement.namedItem("includehints"));
// remove includes element not needed
if(!uiElement.namedItem("includes").isNull())
uiElement.removeChild(uiElement.namedItem("includes"));
// and ensure images and connection are at the end
if(!uiElement.namedItem("connections").isNull())
uiElement.insertAfter(uiElement.namedItem("connections"), TQDomNode());
@ -1484,13 +1484,13 @@ FormIO::addIncludeFileName(const TQString &include, TQDomDocument &domDoc)
TQDomElement includes;
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);
}
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
for(TQDomNode n = includes.firstChild(); !n.isNull(); n = n.nextSibling())
@ -1499,10 +1499,12 @@ FormIO::addIncludeFileName(const TQString &include, TQDomDocument &domDoc)
return;
}
TQDomElement includeHint = domDoc.createElement("includehint");
includes.appendChild(includeHint);
TQDomElement includeElement = domDoc.createElement("include");
includes.appendChild(includeElement);
includeElement.setAttribute("location", "global");
includeElement.setAttribute("impldecl", "in implementation");
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 ////////

@ -204,7 +204,7 @@ class KFORMEDITOR_EXPORT FormIO : public TQObject
static void readChildNodes(ObjectTreeItem *tree, Container *container,
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. */
static void addIncludeFileName(const TQString &include, TQDomDocument &domDoc);

Loading…
Cancel
Save