Was not even written in newer docs.
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=706115
KUrl m_url;
QList<bool> m_sortIdentifier;
bool m_sortLesson;
- bool m_sortingEnabled;
// save these to document
QStringList m_identifiers; //0= origin, 1,.. translations
QString m_version;
QString m_csvDelimiter;
+ /** Categories that can later be used to sork kvtml files:
+ * language, music, children, anatomy
+ */
+ QString m_category;
+
QList<KEduVocArticle> m_articles;
QList<KEduVocConjugation> m_conjugations;
m_sizeHints.clear();
m_vocabulary.clear();
m_dirty = false;
- m_sortingEnabled = true;
m_sortLesson = false;
m_currentLesson = 0;
m_queryorg = "";
}
-void KEduVocDocument::setSortingEnabled(bool enable)
-{
- d->m_sortingEnabled = enable;
-}
-
-
-bool KEduVocDocument::isSortingEnabled() const
-{
- return d->m_sortingEnabled;
-}
-
-
bool KEduVocDocument::isModified() const
{
return d->m_dirty;
/** @returns the modification state of the doc */
bool isModified() const;
- /**
- * Enables sorting
- */
- void setSortingEnabled(bool enable);
-
- /** @returns whether sorting is enabled */
- bool isSortingEnabled() const;
-
/**
* Sets the URL of the XML file
*/
/** @returns the URL of the XML file */
KUrl url() const;
- /** set the title of the XML file
+
+
+ /** set the title of the file
* @param title title to set */
void setTitle(const QString & title);
- /** @returns the title of the XML file */
+ /** @returns the title of the file */
QString title() const;
/** set the author of the file
return false;
}
- currentElement = domElementParent.firstChildElement(KV_OPTION_GRP);
- if (!currentElement.isNull()) {
- result = readOptions(currentElement);
- if (!result)
- return false;
- }
// initialize the list of predefined types
m_doc->wordTypes()->createDefaultWordTypes();
}
-bool KEduVocKvtmlReader::readOptions(QDomElement &domElementParent)
-{
- m_doc->setSortingEnabled(true);
- QDomElement currentElement = domElementParent.firstChildElement(KV_OPT_SORT);
- if (!currentElement.isNull()) {
- QDomAttr attribute = currentElement.attributeNode(KV_BOOL_FLAG);
- if (!attribute.isNull())
- {
- bool ok = true;
- m_doc->setSortingEnabled(attribute.value().toInt(&ok)); // returns 0 if the conversion fails
- if (!ok)
- m_doc->setSortingEnabled(true);
- }
- }
-
- return true;
-}
-
-
bool KEduVocKvtmlReader::readType(QDomElement &domElementParent)
{
QString s;
return false;
}
- if (!writeOption(domDoc, domElementKvtml))
- return false;
-
if (!writeType(domDoc, domElementKvtml))
return false;
}
-bool KEduVocKvtmlWriter::writeOption(QDomDocument &domDoc, QDomElement &domElementParent)
-{
- QDomElement domElementOption = domDoc.createElement(KV_OPTION_GRP);
- QDomElement domElementSort = domDoc.createElement(KV_OPT_SORT);
-
- domElementSort.setAttribute(KV_BOOL_FLAG, (m_doc->isSortingEnabled()?1:0));
- domElementOption.appendChild(domElementSort);
-
- domElementParent.appendChild(domElementOption);
- return true;
-}
-
-
bool KEduVocKvtmlWriter::writeType(QDomDocument &domDoc, QDomElement &domElementParent)
{
/** @todo port to new type handling