[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/kaxul
From:       George Staikos <staikos () kde ! org>
Date:       2003-06-03 19:22:46
[Download RAW message or body]

CVS commit by staikos: 

parse out <script> nodes


  A            test/testcases/allelem.js   1.1
  M +8 -1      kaxul.cpp   1.39
  M +8 -0      kaxul.h   1.12


--- kdenonbeta/kaxul/kaxul.cpp  #1.38:1.39
@@ -88,4 +88,6 @@ void KaXul::clear() {
         _actionCollection.clear();
         _eventList.clear();
+        _scriptFiles.clear();
+        _scripts.clear();
 }
 
@@ -604,4 +606,10 @@ int KaXul::parseNodes(const QDomElement&
                 } else if (e.tagName() == "toolbox") {
                         _toolbox = e;
+                } else if (e.tagName() == "script") {
+                        if (e.hasAttribute("src")) {
+                                _scriptFiles.append(e.attribute("src"));
+                        } else {
+                                _scripts.append(e.text());
+                        }
                 // FIXME: Once this is more complete, switch to a faster
                 //        lookup scheme
@@ -613,5 +621,4 @@ int KaXul::parseNodes(const QDomElement&
                 //} else if (e.tagName() == "arrowscrollbox") { need new widget
                 //} else if (e.tagName() == "statusbar") { how to do this?
-                //} else if (e.tagName() == "script") {
                         // Attribute:
                 } else if (!e.isNull()) {

--- kdenonbeta/kaxul/kaxul.h  #1.11:1.12
@@ -52,4 +52,10 @@ public:
         const QMap<QString,EventList>& eventList() const { return _eventList; }
 
+        // A list of all script files to load
+        const QStringList& scriptFiles() const { return _scriptFiles; }
+
+        // A list all inline scripts
+        const QStringList& scripts() const { return _scripts; }
+
 private:
         /* Creates a <widget> node */
@@ -156,4 +162,6 @@ private:
         QPtrList<Action> _actionCollection;
         QMap<QString, EventList> _eventList;
+        QStringList _scriptFiles;
+        QStringList _scripts;
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic