Hello community,
here is the log from the commit of package libkeduvocdocument for
openSUSE:Factory checked in at 2016-08-31 00:08:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libkeduvocdocument (Old)
and /work/SRC/openSUSE:Factory/.libkeduvocdocument.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libkeduvocdocument"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libkeduvocdocument/libkeduvocdocument.changes
2016-07-24 19:49:11.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.libkeduvocdocument.new/libkeduvocdocument.changes
2016-08-31 00:09:02.000000000 +0200
@@ -1,0 +2,16 @@
+Fri Aug 12 10:29:00 UTC 2016 - [email protected]
+
+- Update to KDE Applications 16.08.0
+ * KDE Applications 16.08.0
+ * https://www.kde.org/announcements/announce-applications-16.08.0.php
+
+
+-------------------------------------------------------------------
+Mon Aug 8 15:41:39 UTC 2016 - [email protected]
+
+- Update to KDE Applications 16.07.90
+ * KDE Applications 16.07.90 (16.08-RC)
+ * https://www.kde.org/announcements/announce-applications-16.07.90.php
+
+
+-------------------------------------------------------------------
Old:
----
libkeduvocdocument-16.04.3.tar.xz
New:
----
libkeduvocdocument-16.08.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libkeduvocdocument.spec ++++++
--- /var/tmp/diff_new_pack.aMEjR4/_old 2016-08-31 00:09:03.000000000 +0200
+++ /var/tmp/diff_new_pack.aMEjR4/_new 2016-08-31 00:09:03.000000000 +0200
@@ -17,7 +17,7 @@
Name: libkeduvocdocument
-Version: 16.04.3
+Version: 16.08.0
Release: 0
Summary: Library for KDE Education Applications
License: GPL-2.0+
++++++ libkeduvocdocument-16.04.3.tar.xz -> libkeduvocdocument-16.08.0.tar.xz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libkeduvocdocument-16.04.3/.gitignore
new/libkeduvocdocument-16.08.0/.gitignore
--- old/libkeduvocdocument-16.04.3/.gitignore 1970-01-01 01:00:00.000000000
+0100
+++ new/libkeduvocdocument-16.08.0/.gitignore 2016-06-16 21:58:51.000000000
+0200
@@ -0,0 +1,3 @@
+build/
+libkeduvocdocument.kdev4
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/autotests/CMakeLists.txt
new/libkeduvocdocument-16.08.0/keduvocdocument/autotests/CMakeLists.txt
--- old/libkeduvocdocument-16.04.3/keduvocdocument/autotests/CMakeLists.txt
2016-02-18 08:51:38.000000000 +0100
+++ new/libkeduvocdocument-16.08.0/keduvocdocument/autotests/CMakeLists.txt
2016-06-16 21:58:51.000000000 +0200
@@ -18,6 +18,8 @@
# keduvocdocumentvalidatortest
# keduvocdocumentfilelockingtest
# openAPItest
+ keduvocdocumenttest
+ emptydocumenttest
)
#Unit Tests linked to objects behind the API wall
@@ -64,5 +66,5 @@
endmacro()
-keduvocdocument_gui_unit_tests(keduvocdocument ${kvocdoc_api_unittests})
+keduvocdocument_non_gui_unit_tests(KEduVocDocument ${kvocdoc_api_unittests})
keduvocdocument_gui_unit_tests_static(keduvocdocument_static
${kvocdoc_unittests})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/autotests/emptydocumenttest.cpp
new/libkeduvocdocument-16.08.0/keduvocdocument/autotests/emptydocumenttest.cpp
---
old/libkeduvocdocument-16.04.3/keduvocdocument/autotests/emptydocumenttest.cpp
1970-01-01 01:00:00.000000000 +0100
+++
new/libkeduvocdocument-16.08.0/keduvocdocument/autotests/emptydocumenttest.cpp
2016-06-16 21:58:51.000000000 +0200
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 2016 by Hartmut Riesenbeck <[email protected]> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include "emptydocumenttest.h"
+
+#include "keduvocdocument.h"
+#include <QTest>
+
+namespace EmptyDocumentTests{
+
+QString EmptyDocumentTest::sm_cappturedMessageOutput = QString();
+
+void EmptyDocumentTest::testConstuctionDestruction()
+{
+ sm_cappturedMessageOutput.clear();
+ QtMessageHandler previouMsgHandler =
qInstallMessageHandler(captureMessageOutput);
+ KEduVocDocument *doc = new KEduVocDocument;
+ delete doc;
+ qInstallMessageHandler(previouMsgHandler);
+
+ QCOMPARE(sm_cappturedMessageOutput, QString());
+}
+
+void EmptyDocumentTest::captureMessageOutput(QtMsgType /*type*/, const
QMessageLogContext &/*context*/, const QString &msg)
+{
+ sm_cappturedMessageOutput = msg;
+}
+
+}
+
+QTEST_MAIN(EmptyDocumentTests::EmptyDocumentTest)
+
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/autotests/emptydocumenttest.h
new/libkeduvocdocument-16.08.0/keduvocdocument/autotests/emptydocumenttest.h
---
old/libkeduvocdocument-16.04.3/keduvocdocument/autotests/emptydocumenttest.h
1970-01-01 01:00:00.000000000 +0100
+++
new/libkeduvocdocument-16.08.0/keduvocdocument/autotests/emptydocumenttest.h
2016-06-16 21:58:51.000000000 +0200
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2016 by Hartmut Riesenbeck <[email protected]> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#ifndef EMPTYDOCUMENTTEST_H
+#define EMPTYDOCUMENTTEST_H
+
+#include <QObject>
+
+namespace EmptyDocumentTests {
+/** @file
+ * \brief Empty KEduVocDocument test application
+ * The creation and destruction of a default constructed
KEduVocDocument object shouldn't
+ * give any error message on stderr.
+ * @author Hartmut Riesenbeck <[email protected]>
+ */
+
+class EmptyDocumentTest : public QObject
+{
+Q_OBJECT
+
+private slots:
+ void testConstuctionDestruction();
+
+private:
+ static void captureMessageOutput(QtMsgType type, const QMessageLogContext
&context, const QString &msg);
+
+private:
+ static QString sm_cappturedMessageOutput;
+};
+}
+
+#endif // EMPTYDOCUMENTTEST_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/autotests/keduvocdocumenttest.cpp
new/libkeduvocdocument-16.08.0/keduvocdocument/autotests/keduvocdocumenttest.cpp
---
old/libkeduvocdocument-16.04.3/keduvocdocument/autotests/keduvocdocumenttest.cpp
1970-01-01 01:00:00.000000000 +0100
+++
new/libkeduvocdocument-16.08.0/keduvocdocument/autotests/keduvocdocumenttest.cpp
2016-06-16 21:58:51.000000000 +0200
@@ -0,0 +1,126 @@
+/***************************************************************************
+ * Copyright (C) 2016 by Hartmut Riesenbeck <[email protected]> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include "keduvocdocument.h"
+#include <QTemporaryFile>
+#include <QTest>
+
+namespace KEduVocDocumentTests {
+/** @file
+ * \brief Various KEduVocDocument tests
+ * This test class contends various tests for public KEduVocDocument methods.
+ * They are used to proof expected behavior before and after apply changes to
the tested methods.
+ * @author Hartmut Riesenbeck <[email protected]>
+ */
+
+class KEduVocDocumentTest : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+ void testDetectFileType();
+ void testOpen();
+
+private:
+ void createTmpTestFileOfType(KEduVocDocument::FileType fileType);
+ QString tmpTestFileName() const;
+ QUrl tmpTestFileUrl() const;
+
+private:
+ QTemporaryFile m_tempTestFile;
+ KEduVocDocument m_documentTemplate;
+};
+
+void KEduVocDocumentTest::initTestCase()
+{
+ if (!m_tempTestFile.open()) {
+ QFAIL("Temporary test file could not be created.");
+ return;
+ }
+ m_tempTestFile.close();
+
+ KEduVocIdentifier lang;
+ lang.setName(QStringLiteral("KEduVocDocument Language Name"));
+ lang.setLocale(QStringLiteral("en"));
+
+ m_documentTemplate.setAuthor(QStringLiteral("KEduVocDocument Tests"));
+ m_documentTemplate.appendIdentifier(lang);
+ m_documentTemplate.setGenerator(QStringLiteral("KEduVocDocument Unit
Tests"));
+}
+
+void KEduVocDocumentTest::testDetectFileType()
+{
+ KEduVocDocument::FileType resultFileType(KEduVocDocument::KvdNone);
+
+ createTmpTestFileOfType(KEduVocDocument::Kvtml);
+ resultFileType = KEduVocDocument::detectFileType(tmpTestFileName());
+ QCOMPARE(resultFileType, KEduVocDocument::Kvtml);
+
+ createTmpTestFileOfType(KEduVocDocument::Csv);
+ resultFileType = KEduVocDocument::detectFileType(tmpTestFileName());
+ QCOMPARE(resultFileType, KEduVocDocument::Csv);
+}
+
+void KEduVocDocumentTest::testOpen()
+{
+ KEduVocDocument::ErrorCode openResult(KEduVocDocument::NoError);
+
+ createTmpTestFileOfType(KEduVocDocument::Kvtml);
+ KEduVocDocument docKvtml;
+ openResult = docKvtml.open(tmpTestFileUrl(),
KEduVocDocument::FileOpenReadOnly);
+ QCOMPARE(openResult, KEduVocDocument::NoError);
+
+ createTmpTestFileOfType(KEduVocDocument::Csv);
+ KEduVocDocument docCsv;
+ openResult = docCsv.open(tmpTestFileUrl(),
KEduVocDocument::FileOpenReadOnly);
+ QCOMPARE(openResult, KEduVocDocument::NoError);
+}
+
+void KEduVocDocumentTest::createTmpTestFileOfType(KEduVocDocument::FileType
fileType)
+{
+ KEduVocDocument::ErrorCode result =
m_documentTemplate.saveAs(tmpTestFileUrl(), fileType);
+ if (result != KEduVocDocument::NoError) {
+ QStringList errorStrings = QStringList() << "NoError" << "Unknown" <<
"InvalidXml"
+ << "FileTypeUnknown" << "FileCannotWrite" << "FileWriterFailed" <<
"FileCannotRead"
+ << "FileReaderFailed"<< "FileDoesNotExist" << "FileLocked" <<
"FileCannotLock"
+ << "FileIsReadOnly";
+ QString failText =QString("Temporary test file could not be saved.
(Error code = %1)");
+ failText = failText.arg(errorStrings.value(result));
+ QFAIL(failText.toLocal8Bit().constData());
+ }
+}
+
+QString KEduVocDocumentTest::tmpTestFileName() const
+{
+ return m_tempTestFile.fileName();
+}
+
+QUrl KEduVocDocumentTest::tmpTestFileUrl() const
+{
+ return QUrl::fromLocalFile(m_tempTestFile.fileName());
+}
+
+}
+
+QTEST_MAIN(KEduVocDocumentTests::KEduVocDocumentTest)
+
+#include "keduvocdocumenttest.moc"
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/keduvocdocument.cpp
new/libkeduvocdocument-16.08.0/keduvocdocument/keduvocdocument.cpp
--- old/libkeduvocdocument-16.04.3/keduvocdocument/keduvocdocument.cpp
2016-02-18 08:51:38.000000000 +0100
+++ new/libkeduvocdocument-16.08.0/keduvocdocument/keduvocdocument.cpp
2016-06-16 21:58:51.000000000 +0200
@@ -130,9 +130,6 @@
delete m_lessonContainer;
delete m_wordTypeContainer;
delete m_leitnerContainer;
-
- m_autosave->remove();
- m_autosave->releaseLock();
delete m_autosave;
}
@@ -217,33 +214,32 @@
}
-KEduVocDocument::FileType KEduVocDocument::detectFileType( const QString
&fileName )
+KEduVocDocument::FileType KEduVocDocument::detectFileType(const QString
&fileName)
{
- QIODevice * f = KFilterDev::deviceForFile( fileName );
- f->open( QIODevice::ReadOnly );
+ KFilterDev f(fileName);
+ f.open(QIODevice::ReadOnly);
- ReaderManager::ReaderPtr reader( ReaderManager::reader( *f ) );
+ ReaderManager::ReaderPtr reader(ReaderManager::reader(f));
- f->close();
- delete f;
+ f.close();
return reader->fileTypeHandled();
}
-KEduVocDocument::ErrorCode KEduVocDocument::open( const QUrl& url,
FileHandlingFlags flags)
+KEduVocDocument::ErrorCode KEduVocDocument::open(const QUrl &url,
FileHandlingFlags flags)
{
// save csv delimiter to preserve it in case this is a csv document
QString csv = d->m_csvDelimiter;
// clear all other properties
d->init();
- if ( !url.isEmpty() ) {
- setUrl( url );
+ if (!url.isEmpty()) {
+ setUrl(url);
}
d->m_csvDelimiter = csv;
KEduVocDocument::ErrorCode errStatus = Unknown;
- QString errorMessage = i18n( "<qt>Cannot open file<br /><b>%1</b></qt>",
url.toDisplayString() );
+ QString errorMessage = i18n("<qt>Cannot open file<br /><b>%1</b></qt>",
url.toDisplayString());
QString temporaryFile;
QTemporaryFile tempFile;
@@ -263,36 +259,35 @@
}
if (flags & FileOpenReadOnly) {
- d->m_isReadOnly = true;
+ d->m_isReadOnly = true;
}
ErrorCode autosaveError = NoError;
if (!d->m_isReadOnly) {
- autosaveError = d->initializeKAutoSave( *d->m_autosave, temporaryFile,
flags );
- if (autosaveError != NoError) {
- return autosaveError;
- }
+ autosaveError = d->initializeKAutoSave(*d->m_autosave, temporaryFile,
flags);
+ if (autosaveError != NoError) {
+ return autosaveError;
+ }
}
- QIODevice * f = KFilterDev::deviceForFile( temporaryFile );
- if ( f->open( QIODevice::ReadOnly ) ) {
+ KFilterDev f(temporaryFile);
+ if (f.open(QIODevice::ReadOnly)) {
- ReaderManager::ReaderPtr reader( ReaderManager::reader( *f ) );
- errStatus = reader->read( *this );
+ ReaderManager::ReaderPtr reader(ReaderManager::reader(f));
+ errStatus = reader->read(*this);
- if ( errStatus != KEduVocDocument::NoError ) {
- errorMessage = i18n( "Could not open or properly read
\"%1\"\n(Error reported: %2)"
- , url.toDisplayString(),
reader->errorMessage() );
+ if (errStatus != KEduVocDocument::NoError) {
+ errorMessage = i18n("Could not open or properly read
\"%1\"\n(Error reported: %2)"
+ , url.toDisplayString(),
reader->errorMessage());
}
} else {
errStatus = FileCannotRead;
}
- f->close();
- delete f;
+ f.close();
- if ( errStatus == KEduVocDocument::NoError ) {
+ if (errStatus == KEduVocDocument::NoError) {
setModified(false);
} else {
qWarning() << errorMessage;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/keduvocdocument.h
new/libkeduvocdocument-16.08.0/keduvocdocument/keduvocdocument.h
--- old/libkeduvocdocument-16.04.3/keduvocdocument/keduvocdocument.h
2016-02-18 08:51:38.000000000 +0100
+++ new/libkeduvocdocument-16.08.0/keduvocdocument/keduvocdocument.h
2016-06-16 21:58:51.000000000 +0200
@@ -126,7 +126,7 @@
* @param flags How to handle expected unusual conditions (i.e. locking)
* @returns ErrorCode
*/
- ErrorCode open( const QUrl& url, FileHandlingFlags flags =
FileDefaultHandling);
+ ErrorCode open(const QUrl &url, FileHandlingFlags flags =
FileDefaultHandling);
/**
* Close a document file and release the lock on the file
@@ -395,7 +395,7 @@
* @param fileName filename
* @return enum of filetype
*/
- static FileType detectFileType( const QString &fileName );
+ static FileType detectFileType(const QString &fileName);
/**
* Create a string with the supported document types, that can be used
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/keduvockvtml2writer.cpp
new/libkeduvocdocument-16.08.0/keduvocdocument/keduvockvtml2writer.cpp
--- old/libkeduvocdocument-16.04.3/keduvocdocument/keduvockvtml2writer.cpp
2016-02-18 08:51:38.000000000 +0100
+++ new/libkeduvocdocument-16.08.0/keduvocdocument/keduvockvtml2writer.cpp
2016-06-16 21:58:51.000000000 +0200
@@ -523,7 +523,7 @@
}
// multiplechoice
- if ( !translation->multipleChoice().isEmpty() ) {
+ if (!translation->getMultipleChoice().isEmpty()) {
QDomElement multipleChoiceElement = m_domDoc.createElement(
KVTML_MULTIPLECHOICE );
writeMultipleChoice( multipleChoiceElement, translation );
translationElement.appendChild( multipleChoiceElement );
@@ -595,7 +595,7 @@
</multiplechoice>
*/
{
- foreach ( const QString &choice, translation->multipleChoice() ) {
+ foreach (const QString &choice, translation->getMultipleChoice()) {
multipleChoiceElement.appendChild( newTextElement( KVTML_CHOICE,
choice ) );
}
return true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/keduvoctranslation.cpp
new/libkeduvocdocument-16.08.0/keduvocdocument/keduvoctranslation.cpp
--- old/libkeduvocdocument-16.04.3/keduvocdocument/keduvoctranslation.cpp
2016-02-18 08:51:38.000000000 +0100
+++ new/libkeduvocdocument-16.08.0/keduvocdocument/keduvoctranslation.cpp
2016-06-16 21:58:51.000000000 +0200
@@ -287,18 +287,39 @@
}
-KEduVocConjugation& KEduVocTranslation::conjugation( const QString& tense )
+KEduVocConjugation& KEduVocTranslation::conjugation(const QString &tense)
{
return d->m_conjugations[tense];
}
-QStringList & KEduVocTranslation::multipleChoice()
+KEduVocConjugation KEduVocTranslation::getConjugation(const QString &tense)
const
+{
+ if (d->m_conjugations.contains(tense)) {
+ return d->m_conjugations[tense];
+ }
+ return KEduVocConjugation();
+}
+
+
+QStringList& KEduVocTranslation::multipleChoice()
+{
+ return d->m_multipleChoice;
+}
+
+
+QStringList KEduVocTranslation::getMultipleChoice() const
{
return d->m_multipleChoice;
}
+void KEduVocTranslation::setMultipleChoice(const QStringList &choices)
+{
+ d->m_multipleChoice = choices;
+}
+
+
QString KEduVocTranslation::pronunciation() const
{
return d->m_pronunciation;
@@ -503,7 +524,7 @@
// conjugation
foreach ( const QString &tense, conjugationTenses() ) {
QDomElement conjugationElement = parent.ownerDocument().createElement(
KVTML_CONJUGATION );
- conjugation(tense).toKVTML2(conjugationElement, tense);
+ getConjugation(tense).toKVTML2(conjugationElement, tense);
if (conjugationElement.hasChildNodes()) {
parent.appendChild( conjugationElement );
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/keduvoctranslation.h
new/libkeduvocdocument-16.08.0/keduvocdocument/keduvoctranslation.h
--- old/libkeduvocdocument-16.04.3/keduvocdocument/keduvoctranslation.h
2016-02-18 08:51:38.000000000 +0100
+++ new/libkeduvocdocument-16.08.0/keduvocdocument/keduvoctranslation.h
2016-06-16 21:58:51.000000000 +0200
@@ -147,11 +147,19 @@
void setLeitnerBox( KEduVocLeitnerBox* leitnerBox );
/**
+ * This method is deprecated, please use @see getConjugation() @see
setConjugation()
* Returns a conjugation if available
* @param tense tense of the requested conjugation
* @return the conjugation
*/
- KEduVocConjugation& conjugation( const QString& tense );
+ KEDUVOCDOCUMENT_DEPRECATED KEduVocConjugation& conjugation(const QString
&tense);
+
+ /**
+ * Returns a conjugation if available
+ * @param tense tense of the requested conjugation
+ * @return the conjugation
+ */
+ KEduVocConjugation getConjugation(const QString &tense) const;
/** adds conjugations or replaces them, if they exist.
* @param conjugation conjugation
@@ -202,14 +210,22 @@
KEduVocText article() const;
void setArticle(const KEduVocText& article);
- /** Returns multiple choice if available
- */
- QStringList & multipleChoice();
+ /**
+ * This method is deprecated, please use @see getMultipleChoice() @see
setMultipleChoice()
+ * Returns multiple choice if available
+ */
+ KEDUVOCDOCUMENT_DEPRECATED QStringList& multipleChoice();
+
+ /**
+ * Returns multiple choice if available
+ * @return list of multiple choice answers
+ */
+ QStringList getMultipleChoice() const;
/** Sets multiple choice
- * @param mc multiple choice block
- */
-// void setMultipleChoice( const QStringList &mc );
+ * @param choices multiple choice block
+ */
+ void setMultipleChoice(const QStringList &choices);
/** Get the sound url for this translation if it exists */
QUrl soundUrl();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/readerwriters/keduvockvtml2reader.cpp
new/libkeduvocdocument-16.08.0/keduvocdocument/readerwriters/keduvockvtml2reader.cpp
---
old/libkeduvocdocument-16.04.3/keduvocdocument/readerwriters/keduvockvtml2reader.cpp
2016-02-18 08:51:38.000000000 +0100
+++
new/libkeduvocdocument-16.08.0/keduvocdocument/readerwriters/keduvockvtml2reader.cpp
2016-06-16 21:58:51.000000000 +0200
@@ -700,7 +700,9 @@
{
currentElement = choiceNodes.item( i ).toElement();
if ( currentElement.parentNode() == multipleChoiceElement ) {
- translation->multipleChoice().append( currentElement.text() );
+ QStringList choices = translation->getMultipleChoice();
+ choices.append(currentElement.text());
+ translation->setMultipleChoice(choices);
}
}
return true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libkeduvocdocument-16.04.3/keduvocdocument/readerwriters/keduvockvtmlreader.cpp
new/libkeduvocdocument-16.08.0/keduvocdocument/readerwriters/keduvockvtmlreader.cpp
---
old/libkeduvocdocument-16.04.3/keduvocdocument/readerwriters/keduvockvtmlreader.cpp
2016-02-18 08:51:38.000000000 +0100
+++
new/libkeduvocdocument-16.08.0/keduvocdocument/readerwriters/keduvockvtmlreader.cpp
2016-06-16 21:58:51.000000000 +0200
@@ -337,7 +337,32 @@
nat_indef = "";
}
- m_doc->identifier(i).setArticle( KEduVocArticle( fem_def,
fem_indef, mal_def, mal_indef, nat_def, nat_indef ) );
+ KEduVocArticle article;
+ article.setArticle(
+ mal_def,
+ KEduVocWordFlag::Singular | KEduVocWordFlag::Definite |
KEduVocWordFlag::Masculine
+ );
+ article.setArticle(
+ fem_def,
+ KEduVocWordFlag::Singular | KEduVocWordFlag::Definite |
KEduVocWordFlag::Feminine
+ );
+ article.setArticle(
+ nat_def,
+ KEduVocWordFlag::Singular | KEduVocWordFlag::Definite |
KEduVocWordFlag::Neuter
+ );
+ article.setArticle(
+ mal_indef,
+ KEduVocWordFlag::Singular | KEduVocWordFlag::Indefinite |
KEduVocWordFlag::Masculine
+ );
+ article.setArticle(
+ fem_indef,
+ KEduVocWordFlag::Singular | KEduVocWordFlag::Indefinite |
KEduVocWordFlag::Feminine
+ );
+ article.setArticle(
+ nat_indef,
+ KEduVocWordFlag::Singular | KEduVocWordFlag::Indefinite |
KEduVocWordFlag::Neuter
+ );
+ m_doc->identifier(i).setArticle(article);
}
}
@@ -670,10 +695,10 @@
QDomElement currentElement;
currentElement = domElementParent.firstChildElement( KV_COMP_L2 );
- translation->setComparative(currentElement.text());
+ translation->setComparativeForm(currentElement.text());
currentElement = domElementParent.firstChildElement( KV_COMP_L3 );
- translation->setSuperlative(currentElement.text());
+ translation->setSuperlativeForm(currentElement.text());
return true;
}
@@ -692,32 +717,35 @@
{
QDomElement currentElement;
+ QStringList choices = translation->getMultipleChoice();
currentElement = domElementParent.firstChildElement( KV_MC_1 );
if ( !currentElement.isNull() ) {
- translation->multipleChoice().append( currentElement.text() );
+ choices.append(currentElement.text());
}
currentElement = domElementParent.firstChildElement( KV_MC_2 );
if ( !currentElement.isNull() ) {
- translation->multipleChoice().append( currentElement.text() );
+ choices.append(currentElement.text());
}
currentElement = domElementParent.firstChildElement( KV_MC_3 );
if ( !currentElement.isNull() ) {
- translation->multipleChoice().append( currentElement.text() );
+ choices.append(currentElement.text());
}
currentElement = domElementParent.firstChildElement( KV_MC_4 );
if ( !currentElement.isNull() ) {
- translation->multipleChoice().append( currentElement.text() );
+ choices.append(currentElement.text());
}
currentElement = domElementParent.firstChildElement( KV_MC_5 );
if ( !currentElement.isNull() ) {
- translation->multipleChoice().append( currentElement.text() );
+ choices.append(currentElement.text());
}
+ translation->setMultipleChoice(choices);
+
return true;
}