diff options
Diffstat (limited to 'kexi/formeditor/scripting/scriptIO.cpp')
-rw-r--r-- | kexi/formeditor/scripting/scriptIO.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/kexi/formeditor/scripting/scriptIO.cpp b/kexi/formeditor/scripting/scriptIO.cpp index 8620a8ae..ee0b1f59 100644 --- a/kexi/formeditor/scripting/scriptIO.cpp +++ b/kexi/formeditor/scripting/scriptIO.cpp @@ -27,30 +27,30 @@ #include "main/scriptcontainer.h" bool -ScriptIO::saveFormEvents(QDomNode &parentNode, FormScript *formScript) +ScriptIO::saveFormEvents(TQDomNode &tqparentNode, FormScript *formScript) { - QDomDocument domDoc = parentNode.ownerDocument(); + TQDomDocument domDoc = tqparentNode.ownerDocument(); // Save the form's code if(!formScript->getCode().isEmpty()) { - QDomElement script = domDoc.createElement("script"); + TQDomElement script = domDoc.createElement("script"); script.setAttribute("language", formScript->scriptContainer()->getInterpreterName()); - parentNode.appendChild(script); - QDomText scriptCode = domDoc.createTextNode(formScript->getCode()); + tqparentNode.appendChild(script); + TQDomText scriptCode = domDoc.createTextNode(formScript->getCode()); script.appendChild(scriptCode); } // Save all form events if(!formScript->eventList()->isEmpty()) - saveEventList(formScript->eventList(), parentNode); + saveEventList(formScript->eventList(), tqparentNode); return true; } bool -ScriptIO::loadFormEvents(QDomNode &parentNode, Form *form, ScriptManager *manager) +ScriptIO::loadFormEvents(TQDomNode &tqparentNode, Form *form, ScriptManager *manager) { - QDomElement script = parentNode.namedItem("script").toElement(); - QDomElement events = parentNode.namedItem("events").toElement(); + TQDomElement script = tqparentNode.namedItem("script").toElement(); + TQDomElement events = tqparentNode.namedItem("events").toElement(); // Load script code FormScript *formScript = new FormScript(form, manager); @@ -61,14 +61,14 @@ ScriptIO::loadFormEvents(QDomNode &parentNode, Form *form, ScriptManager *manage // Load all events in the EventList if(!events.isNull()) { - for(QDomNode n = events.firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = events.firstChild(); !n.isNull(); n = n.nextSibling()) loadEvent(n, formScript->eventList(), form); } return true; } bool -ScriptIO::saveAllEventsForWidget(QObject *widget, FormScript *formScript, QDomNode &node) +ScriptIO::saveAllEventsForWidget(TQObject *widget, FormScript *formScript, TQDomNode &node) { EventList *l = formScript->eventList()->allEventsForObject(widget); saveEventList(l, node); @@ -76,54 +76,54 @@ ScriptIO::saveAllEventsForWidget(QObject *widget, FormScript *formScript, QDomNo } void -ScriptIO::saveEvent(Event *event, QDomNode &parentNode) +ScriptIO::saveEvent(Event *event, TQDomNode &tqparentNode) { if(!event) return; - QDomDocument domDoc = parentNode.ownerDocument(); - QDomElement eventNode = domDoc.createElement("event"); + TQDomDocument domDoc = tqparentNode.ownerDocument(); + TQDomElement eventNode = domDoc.createElement("event"); eventNode.setAttribute("type", event->type()); - parentNode.appendChild(eventNode); + tqparentNode.appendChild(eventNode); switch(event->type()) { case Event::Slot: { - QDomElement sender = domDoc.createElement("sender"); + TQDomElement sender = domDoc.createElement("sender"); eventNode.appendChild(sender); - QDomText senderText = domDoc.createTextNode(event->sender() ? event->sender()->name() : ""); + TQDomText senderText = domDoc.createTextNode(event->sender() ? event->sender()->name() : ""); sender.appendChild(senderText); - QDomElement signal = domDoc.createElement("signal"); + TQDomElement signal = domDoc.createElement("signal"); eventNode.appendChild(signal); - QDomText signalText = domDoc.createTextNode(event->signal()); + TQDomText signalText = domDoc.createTextNode(event->signal()); signal.appendChild(signalText); - QDomElement receiver = domDoc.createElement("receiver"); + TQDomElement receiver = domDoc.createElement("receiver"); eventNode.appendChild(receiver); - QDomText receiverText = domDoc.createTextNode(event->receiver() ? event->receiver()->name() : ""); + TQDomText receiverText = domDoc.createTextNode(event->receiver() ? event->receiver()->name() : ""); receiver.appendChild(receiverText); - QDomElement slot = domDoc.createElement("slot"); + TQDomElement slot = domDoc.createElement("slot"); eventNode.appendChild(slot); - QDomText slotText = domDoc.createTextNode(event->slot()); + TQDomText slotText = domDoc.createTextNode(event->slot()); slot.appendChild(slotText); break; } case Event::UserFunction: { - QDomElement sender = domDoc.createElement("sender"); + TQDomElement sender = domDoc.createElement("sender"); eventNode.appendChild(sender); - QDomText senderText = domDoc.createTextNode(event->sender() ? event->sender()->name() : ""); + TQDomText senderText = domDoc.createTextNode(event->sender() ? event->sender()->name() : ""); sender.appendChild(senderText); - QDomElement signal = domDoc.createElement("signal"); + TQDomElement signal = domDoc.createElement("signal"); eventNode.appendChild(signal); - QDomText signalText = domDoc.createTextNode(event->signal()); + TQDomText signalText = domDoc.createTextNode(event->signal()); signal.appendChild(signalText); - QDomElement function = domDoc.createElement("function"); + TQDomElement function = domDoc.createElement("function"); eventNode.appendChild(function); - QDomText functionText = domDoc.createTextNode(event->slot()); + TQDomText functionText = domDoc.createTextNode(event->slot()); function.appendChild(functionText); break; } @@ -138,22 +138,22 @@ ScriptIO::saveEvent(Event *event, QDomNode &parentNode) } void -ScriptIO::saveEventList(EventList *list, QDomNode &parentNode) +ScriptIO::saveEventList(EventList *list, TQDomNode &tqparentNode) { if(!list || list->isEmpty()) return; - QDomDocument domDoc = parentNode.ownerDocument(); - QDomElement events = domDoc.createElement("events"); - parentNode.appendChild(events); + TQDomDocument domDoc = tqparentNode.ownerDocument(); + TQDomElement events = domDoc.createElement("events"); + tqparentNode.appendChild(events); - QValueListConstIterator<Event*> endIt = list->constEnd(); - for(QValueListConstIterator<Event*> it = list->constBegin(); it != endIt; ++it) + TQValueListConstIterator<Event*> endIt = list->constEnd(); + for(TQValueListConstIterator<Event*> it = list->constBegin(); it != endIt; ++it) saveEvent((*it), events); } void -ScriptIO::loadEvent(QDomNode &node, EventList *list, Form *form) +ScriptIO::loadEvent(TQDomNode &node, EventList *list, Form *form) { int type = node.toElement().attribute("type").toInt(); Event *event = new Event(); |