]> Git trees. - libqmvoc.git/commitdiff
numIdentifiers() -> identifierCount() for API consistency
authorPeter Hedlund <peter@peterandlinda.com>
Tue, 27 Feb 2007 22:32:57 +0000 (22:32 +0000)
committerPeter Hedlund <peter@peterandlinda.com>
Tue, 27 Feb 2007 22:32:57 +0000 (22:32 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=637824

kdeeducore/keduvocdocument.cpp
kdeeducore/keduvocdocument.h
kdeeducore/keduvockvtmlreader.cpp
kdeeducore/keduvockvtmlwriter.cpp

index 0e08f3288cc2f0d4ecf0f14faf2ceea683555368..bc91a62174988fc147e800cfa6e3b6e803012412 100644 (file)
@@ -564,7 +564,7 @@ void KEduVocDocument::setOriginalIdentifier(const QString &id)
 bool KEduVocDocument::sort(int index, Qt::SortOrder order)
 {
   bool result = false;
-  if (m_sortingEnabled && index < numIdentifiers())
+  if (m_sortingEnabled && index < identifierCount())
   {
     if (m_sortIdentifier.count() < m_identifiers.count())
       for (int i = m_sortIdentifier.count(); i < (int) m_identifiers.count(); i++)
@@ -579,7 +579,7 @@ bool KEduVocDocument::sort(int index, Qt::SortOrder order)
 bool KEduVocDocument::sort(int index)
 {
   bool result = false;
-  if (m_sortingEnabled && index < numIdentifiers())
+  if (m_sortingEnabled && index < identifierCount())
   {
     if (m_sortIdentifier.count() < m_identifiers.count())
       for (int i = m_sortIdentifier.count(); i < (int) m_identifiers.count(); i++)
@@ -796,7 +796,7 @@ int KEduVocDocument::search(const QString &substr, int id, int first, int last,
   if (first < 0)
     first = 0;
 
-  if (id >= numIdentifiers() || last < first)
+  if (id >= identifierCount() || last < first)
     return -1;
 
   if (id == 0) {
@@ -888,7 +888,7 @@ int KEduVocDocument::cleanUp()
 
     bool equal = true;
     if (kve1->original() == kve2->original() ) {
-      for (int l = 1; equal && l < (int) numIdentifiers(); l++ )
+      for (int l = 1; equal && l < identifierCount(); l++ )
         if (kve1->translation(l) != kve2->translation(l))
           equal = false;
 
index 7d4137d226ecf54a35f370e67851511dd7055f2b..784adcc669544875b0e5979b7b55533a05f82974 100644 (file)
@@ -518,7 +518,7 @@ public:
   /**
    * @returns the number of different identifiers (usually languages)
    */
-  inline int numIdentifiers() const { return m_identifiers.count(); } // org + translations
+  inline int identifierCount() const { return m_identifiers.count(); } // org + translations
 
   /**
    * Appends a new identifier (usually a language)
index 4bf9668532e24c194c2dc4e4f6c733c5eb5bfecb..f0f81209200420197d7e591371351103fa0bd338 100644 (file)
@@ -282,7 +282,7 @@ bool KEduVocKvtmlReader::readArticle(QDomElement &domElementParent)
       QString lang;
       attribute = currentElement.attributeNode(KV_LANG);
 
-      if (m_doc->numIdentifiers() <= i)
+      if (m_doc->identifierCount() <= i)
       {
         // first entry
         if (!attribute.isNull())         // no definition in first entry
@@ -427,7 +427,7 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, QList<KEduVoc
       QString lang;
       QDomAttr domAttrLang = domElementConjugChild.attributeNode(KV_LANG);
 
-      if (m_doc->numIdentifiers() <= count)
+      if (m_doc->identifierCount() <= count)
       {
         // first entry
         if (!domAttrLang.isNull())            // no definition in first entry
@@ -1157,7 +1157,7 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent)
       q_trans = lang;
   }
 
-  if (m_doc->numIdentifiers() == 0)
+  if (m_doc->identifierCount() == 0)
   {
     // first entry
     if (lang.isEmpty())                 // no definition in first entry
@@ -1277,13 +1277,13 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent)
 
       }
 
-      if (m_doc->numIdentifiers() <= count)
+      if (m_doc->identifierCount() <= count)
       {
         // new translation
         if (lang.isEmpty())
         {
           // no definition in first entry ?
-          lang.setNum(m_doc->numIdentifiers());
+          lang.setNum(m_doc->identifierCount());
           lang.prepend("translation ");
         }
         m_doc->appendIdentifier(lang);
index dcbcbf73d3671114b3d07e1b76c3349c0a395b3c..9619afc5efb5fb124ce745de5d10022902cba36a 100644 (file)
@@ -43,7 +43,7 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator
 
   domElementKvtml.setAttribute(KV_ENCODING, (QString) "UTF-8");
   domElementKvtml.setAttribute(KV_GENERATOR, generator);
-  domElementKvtml.setAttribute(KV_COLS, m_doc->numIdentifiers());
+  domElementKvtml.setAttribute(KV_COLS, m_doc->identifierCount());
   domElementKvtml.setAttribute(KV_LINES, m_doc->numEntries());
 
   if (!m_doc->title().isEmpty())
@@ -185,7 +185,7 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator
     domElementExpression.appendChild(domElementOriginal);
 
     int trans = 1;
-    while (trans < m_doc->numIdentifiers())
+    while (trans < m_doc->identifierCount())
     {
       QDomElement domElementTranslation = domDoc.createElement(KV_TRANS);
       if (first_expr)
@@ -356,7 +356,7 @@ bool KEduVocKvtmlWriter::writeArticle(QDomDocument &domDoc, QDomElement &domElem
   QString indef;
   QString s;
 
-  for (int lfn = 0; lfn < qMin(m_doc->articleCount(), m_doc->numIdentifiers()); lfn++)
+  for (int lfn = 0; lfn < qMin(m_doc->articleCount(), m_doc->identifierCount()); lfn++)
   {
     QDomElement domElementEntry = domDoc.createElement(KV_ART_ENTRY);
     if (lfn == 0)
@@ -668,7 +668,7 @@ bool KEduVocKvtmlWriter::writeConjugHeader(QDomDocument &domDoc, QDomElement &do
   QDomElement domElementConjug = domDoc.createElement(KV_CONJUG_GRP);
   QString s;
 
-  for (int ent = 0; ent < qMin(curr_conjug.count(), m_doc->numIdentifiers()); ent++)
+  for (int ent = 0; ent < qMin(curr_conjug.count(), m_doc->identifierCount()); ent++)
   {
     QDomElement domElementEntry = domDoc.createElement(KV_CON_ENTRY);