]> Git trees. - libqmvoc.git/commitdiff
* make one methods virtual
authorCarsten Niehaus <cniehaus@gmx.de>
Mon, 4 Jul 2005 11:20:20 +0000 (11:20 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Mon, 4 Jul 2005 11:20:20 +0000 (11:20 +0000)
* API-DOC
* rename some parameters
* make more code work

svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=431447

kdeeduui/kdeeduglossary.cpp
kdeeduui/kdeeduglossary.h

index fad0048ed77940cbbba2c8f7a849004943995d8c..f6b020897b36a1782689ac63f0b72c194c8a9d6b 100644 (file)
 #include <qstringlist.h>
 #include <qtoolbutton.h>
 
-bool Glossary::loadLayout( QDomDocument &questionDocument, const KURL& url )
+bool Glossary::loadLayout( QDomDocument &Document, const KURL& url )
 {
         QFile layoutFile( url.path() );
 
         if (!layoutFile.exists())
                        kdDebug() << "no such file: " << layoutFile.name() << endl;
-//X 
-//X            //TODO really needed?
-//X         if (!layoutFile.open(IO_ReadOnly))
-//X                 return false;
-//X 
-//X         ///Check if document is well-formed
-//X         if (!questionDocument.setContent(&layoutFile))
-//X         {
-//X                 kdDebug() << "wrong xml" << endl;
-//X                 layoutFile.close();
-//X                 return false;
-//X         }
-//X         layoutFile.close();
+               
+        if (!layoutFile.open(IO_ReadOnly))
+                return false;
+
+        ///Check if document is well-formed
+        if (!Document.setContent(&layoutFile))
+        {
+                kdDebug() << "wrong xml" << endl;
+                layoutFile.close();
+                return false;
+        }
+        layoutFile.close();
 
         return true;
 }
 
+
 Glossary* Glossary::readFromXML( const KURL& url )
 {
        QDomDocument doc( "document" );
index 63e9543011101ab48abbde513585a32c80019934..e8c11eef83cef23f995d89bcb9d43ce3ce21d51b 100644 (file)
@@ -69,10 +69,23 @@ class Glossary
                        return m_name;
                }
 
+               /**
+                * sets the internal list of items to @p list
+                */
                void setItemlist( QValueList<GlossaryItem*> list ){
                        m_itemlist = list;
                }
 
+               static Glossary* readFromXML( const KURL& url );
+       
+       private:
+               /**
+                * This methods parses the given xml-code. It will extract
+                * the information of the items and return them as a
+                * QValueList<GlossaryItem*>
+                */
+               virtual QValueList<GlossaryItem*> readItems( QDomDocument &itemDocument );
+               
                /**
                 * Read a glossary from an XML file.
                 *
@@ -81,15 +94,13 @@ class Glossary
                 * @return a pointer to the loaded glossary. Even in case of
                 *         error, this won't return 0 but an empty Glossary.
                 */
-               static Glossary* readFromXML( const KURL& url );
-       
-       private:
-               QValueList<GlossaryItem*> readItems( QDomDocument &itemDocument );
-               
                bool loadLayout( QDomDocument&, const KURL& url );
-               
+       
                QValueList<GlossaryItem*> m_itemlist;
                
+               /**
+                * the name of the glossary
+                */
                QString m_name;
 };