From: Peter Hedlund Date: Tue, 27 Feb 2007 22:32:57 +0000 (+0000) Subject: numIdentifiers() -> identifierCount() for API consistency X-Git-Tag: v3.90.1~72 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=7bd32731142ba3f1f112489e90f061df95d3f2cd;p=libqmvoc.git numIdentifiers() -> identifierCount() for API consistency svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=637824 --- diff --git a/kdeeducore/keduvocdocument.cpp b/kdeeducore/keduvocdocument.cpp index 0e08f32..bc91a62 100644 --- a/kdeeducore/keduvocdocument.cpp +++ b/kdeeducore/keduvocdocument.cpp @@ -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; diff --git a/kdeeducore/keduvocdocument.h b/kdeeducore/keduvocdocument.h index 7d4137d..784adcc 100644 --- a/kdeeducore/keduvocdocument.h +++ b/kdeeducore/keduvocdocument.h @@ -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) diff --git a/kdeeducore/keduvockvtmlreader.cpp b/kdeeducore/keduvockvtmlreader.cpp index 4bf9668..f0f8120 100644 --- a/kdeeducore/keduvockvtmlreader.cpp +++ b/kdeeducore/keduvockvtmlreader.cpp @@ -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, QListnumIdentifiers() <= 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); diff --git a/kdeeducore/keduvockvtmlwriter.cpp b/kdeeducore/keduvockvtmlwriter.cpp index dcbcbf7..9619afc 100644 --- a/kdeeducore/keduvockvtmlwriter.cpp +++ b/kdeeducore/keduvockvtmlwriter.cpp @@ -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);