Commit b889dc52 authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Merge branch 'frameworks'

parents d823f4b3 0bce69e3
###
# Copyright 2013-2014 Andreas Cord-Landwehr <cordlandwehr@kde.org>
# Copyright 2013-2015 Andreas Cord-Landwehr <cordlandwehr@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
......@@ -25,31 +25,58 @@
project(artikulate)
find_package(KDE4 4.11.1 REQUIRED)
include(KDE4Defaults)
cmake_minimum_required(VERSION 3.0.0)
find_package(ECM 5.13.0 REQUIRED NO_MODULE)
find_package(KF5DocTools)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${QT4_INCLUDES})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -fexceptions)
include(KDEInstallDirs)
include(ECMAddTests)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(ECMInstallIcons)
include(ECMOptionalAddSubdirectory)
include(ECMSetupVersion)
include(FeatureSummary)
include(GenerateExportHeader)
find_package(Qt5 5.5 REQUIRED COMPONENTS
Widgets
Sql
XmlPatterns
Qml
Quick
QuickWidgets
Test
)
find_package(KF5 REQUIRED COMPONENTS
Config
ConfigWidgets
Declarative
I18n
NewStuff
WidgetsAddons
XmlGui
)
add_definitions(
-DQT_NO_URL_CAST_FROM_STRING
)
# subdirectories to build
add_subdirectory(data)
add_subdirectory(schemes)
add_subdirectory(doc)
add_subdirectory(src)
add_subdirectory(sounds)
add_subdirectory(images)
add_subdirectory(icons)
add_subdirectory(libsound)
add_subdirectory(liblearnerprofile)
# Build Tests if KDE_TEST is on
if(KDE4_BUILD_TESTS)
enable_testing()
add_subdirectory(autotests)
endif(KDE4_BUILD_TESTS)
ecm_optional_add_subdirectory(data)
ecm_optional_add_subdirectory(schemes)
ecm_optional_add_subdirectory(doc)
ecm_optional_add_subdirectory(src)
ecm_optional_add_subdirectory(sounds)
ecm_optional_add_subdirectory(images)
ecm_optional_add_subdirectory(icons)
ecm_optional_add_subdirectory(libsound)
ecm_optional_add_subdirectory(liblearnerprofile)
ecm_optional_add_subdirectory(autotests)
# files to install in the artikulate project root directory
install(PROGRAMS artikulate.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES artikulate.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata/)
install(PROGRAMS org.kde.artikulate.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES org.kde.artikulate.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata/)
macro_display_feature_log()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Packaging and Building Information
==================================
Artikulate
==========
Artikulate is a language learning application that helps improving pronunciation skills for
various languages. This repository maintains the application and language specifications. All course
......@@ -9,15 +9,15 @@ infrastructure.
For a detailed explanation how to contribute new languages and/or new courses, please refer to the
information at techbase: http://techbase.kde.org/Projects/Edu/Artikulate
# Build Dependencies
* contribute: please go to phabricator.kde.org
Artikulate has the following build dependencies:
Packaging and Building Information
==================================
* KDElibs >= 4.11.1
* Qt >= 4.8 (but less than Qt 5.x)
* CMake >= 2.8.9
* QtGStreamer >= 1.1.90 (i.e., based on GStreamer-1.x)
# Build Dependencies
All build dependencies are defined in the CMake files. Please run CMake and and consider the
the output.
# Packaging
......@@ -31,9 +31,7 @@ internally inside Artikulate:
# Runtime Dependencies
* kqtquickcharts: a KDE Edu library that provides a QtQuick plugin for plotting graphs
* KDE-runtime >= 4.11.1
* none
# GStreamer-Problems
......@@ -54,3 +52,4 @@ CMake files are BSD licensed.
# Patches and Bug Reports
Please use the bugs.kde.org or the git.reviewboard.kde.org infrastructure for this.
###
# Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
# Copyright 2013-2014 Andreas Cord-Landwehr <cordlandwehr@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
......@@ -25,6 +25,7 @@
include_directories(
../src/
../
${CMAKE_CURRENT_BINARY_DIR}
)
......@@ -34,47 +35,27 @@ file(COPY ../data/languages DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data) # copy
file(COPY testcourses/de.xml DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/courses) # copy test files
file(COPY testcourses/fr.xml DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/courses) # copy test files
# basic tests course files (input/output)
set (TestCourseFiles_SRCS
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
set(TestCourseFiles_SRCS
testcoursefiles.cpp
)
kde4_add_kcfg_files(TestCourseFiles_SRCS ../src/settings.kcfgc)
kde4_add_executable(TestCourseFiles ${TestCourseFiles_SRCS} )
kconfig_add_kcfg_files(TestCourseFiles_SRCS ../src/settings.kcfgc)
add_executable(TestCourseFiles ${TestCourseFiles_SRCS} )
target_link_libraries(TestCourseFiles
artikulatecore
${QT_QTTEST_LIBRARY}
${KDECLARATIVE_LIBRARIES}
${KDE4_KDEUI_LIBS}
${KDE4_PLASMA_LIBS}
${KDE4_KIO_LIBS}
${KDE4_KCMUTILS_LIBS}
${QT_QTCORE_LIBRARY}
${QT_QTOPENGL_LIBRARY}
${QT_QTSCRIPT_LIBRARY}
${QT_QTDECLARATIVE_LIBRARY}
${QT_QTXMLPATTERNS_LIBRARY}
${QT_QTSQL_LIBRARY}
Qt5::Test
)
add_test(TestCourseFiles TestCourseFiles)
ecm_mark_as_test(TestCourseFiles)
# basic tests language files (input/output)
set (TestLanguageFiles_SRCS
set(TestLanguageFiles_SRCS
testlanguagefiles.cpp
)
kde4_add_executable(TestLanguageFiles ${TestLanguageFiles_SRCS} )
add_executable(TestLanguageFiles ${TestLanguageFiles_SRCS} )
target_link_libraries(TestLanguageFiles
artikulatecore
${QT_QTTEST_LIBRARY}
${KDECLARATIVE_LIBRARIES}
${KDE4_KDEUI_LIBS}
${KDE4_PLASMA_LIBS}
${KDE4_KIO_LIBS}
${KDE4_KCMUTILS_LIBS}
${QT_QTCORE_LIBRARY}
${QT_QTOPENGL_LIBRARY}
${QT_QTSCRIPT_LIBRARY}
${QT_QTDECLARATIVE_LIBRARY}
${QT_QTXMLPATTERNS_LIBRARY}
${QT_QTSQL_LIBRARY}
Qt5::Test
)
add_test(TestLanguageFiles TestLanguageFiles)
ecm_mark_as_test(TestLanguageFiles)
......@@ -28,10 +28,9 @@
#include "core/resources/courseresource.h"
#include "../src/settings.h"
#include <qtest_kde.h>
#include <KDebug>
#include <KTemporaryFile>
#include <KStandardDirs>
#include <QTest>
#include <QDebug>
#include <QTemporaryFile>
#include <QIODevice>
#include <QFile>
......@@ -46,31 +45,32 @@ TestCourseFiles::TestCourseFiles()
void TestCourseFiles::init()
{
KGlobal::dirs()->addResourceDir("appdata" , "./testcourses/");
KGlobal::dirs()->addResourceDir("appdata" , "./");
KGlobal::dirs()->addResourceDir("appdata" , "./autotests/");
KGlobal::dirs()->addResourceDir("appdata" , "./autotests/testcourses/");
//FIXME has to be ported
// KGlobal::dirs()->addResourceDir("appdata" , "./testcourses/");
// KGlobal::dirs()->addResourceDir("appdata" , "./");
// KGlobal::dirs()->addResourceDir("appdata" , "./autotests/");
// KGlobal::dirs()->addResourceDir("appdata" , "./autotests/testcourses/");
systemUseCourseRepositoryValue = Settings::useCourseRepository();
Settings::setUseCourseRepository(false);
Settings::self()->writeConfig();
Settings::self()->save();
}
void TestCourseFiles::cleanup()
{
// reset value
Settings::setUseCourseRepository(systemUseCourseRepositoryValue);
Settings::self()->writeConfig();
Settings::self()->save();
}
void TestCourseFiles::courseSchemeValidationTest()
{
KUrl schemeFile = KUrl::fromLocalFile("schemes/course.xsd");
QUrl schemeFile = QUrl::fromLocalFile("schemes/course.xsd");
QXmlSchema courseSchema;
QVERIFY(courseSchema.load(schemeFile));
QVERIFY(courseSchema.isValid());
KUrl skeletonFile = KUrl::fromLocalFile("schemes/skeleton.xsd");
QUrl skeletonFile = QUrl::fromLocalFile("schemes/skeleton.xsd");
QXmlSchema skeletonScheme;
QVERIFY(skeletonScheme.load(skeletonFile));
QVERIFY(skeletonScheme.isValid());
......@@ -79,29 +79,28 @@ void TestCourseFiles::courseSchemeValidationTest()
void TestCourseFiles::fileLoadSaveCompleteness()
{
ResourceManager manager;
manager.addLanguage(KUrl::fromLocalFile("data/languages/de.xml"));
manager.addCourse(KUrl::fromLocalFile("data/courses/de.xml"));
manager.addLanguage(QUrl::fromLocalFile("data/languages/de.xml"));
manager.addCourse(QUrl::fromLocalFile("data/courses/de.xml"));
// test to encure further logic
QVERIFY(manager.courseResources(manager.languageResources().first()->language()).count() == 1);
Course *testCourse = manager.courseResources(manager.languageResources().first()->language()).first()->course();
KTemporaryFile outputFile;
outputFile.setSuffix(".xml");
QTemporaryFile outputFile;
outputFile.open();
KUrl oldFileName = testCourse->file();
testCourse->setFile(KUrl::fromLocalFile(outputFile.fileName()));
QUrl oldFileName = testCourse->file();
testCourse->setFile(QUrl::fromLocalFile(outputFile.fileName()));
testCourse->setLanguage(manager.languageResources().first()->language());
testCourse->sync();
testCourse->setFile(oldFileName); // restore for later tests
QFile file(outputFile.fileName());
if (!file.open(QIODevice::ReadOnly)) {
kFatal() << "Could not open file to read.";
qCritical() << "Could not open file to read.";
}
//TODO this only works, since the resource manager not checks uniqueness of course ids!
manager.addCourse(KUrl::fromLocalFile(outputFile.fileName()));
manager.addCourse(QUrl::fromLocalFile(outputFile.fileName()));
Course *compareCourse = manager.courseResources(manager.languageResources().first()->language()).last()->course();
// test that we actually call the different files
......@@ -139,4 +138,4 @@ void TestCourseFiles::fileLoadSaveCompleteness()
}
QTEST_KDEMAIN_CORE(TestCourseFiles)
QTEST_MAIN(TestCourseFiles)
......@@ -25,23 +25,24 @@
#include "core/unit.h"
#include "core/phrase.h"
#include <qtest_kde.h>
#include <KDebug>
#include <KTemporaryFile>
#include <KStandardDirs>
#include <KUrl>
#include <QTest>
#include <QDebug>
#include <QTemporaryFile>
#include <QUrl>
#include <QIODevice>
#include <QFile>
#include <QXmlSchema>
#include <QXmlSchemaValidator>
#include <QDomDocument>
#include <QStandardPaths>
TestLanguageFiles::TestLanguageFiles()
{
KGlobal::dirs()->addResourceDir("appdata" , "./autotests/data");
KGlobal::dirs()->addResourceDir("appdata" , "./autotests");
KGlobal::dirs()->addResourceDir("appdata" , "./");
//FIXME port this
// KGlobal::dirs()->addResourceDir("appdata" , "./autotests/data");
// KGlobal::dirs()->addResourceDir("appdata" , "./autotests");
// KGlobal::dirs()->addResourceDir("appdata" , "./");
}
void TestLanguageFiles::init()
......@@ -57,21 +58,21 @@ void TestLanguageFiles::cleanup()
QXmlSchema TestLanguageFiles::loadXmlSchema(const QString &schemeName) const
{
QString relPath = QString("schemes/%1.xsd").arg(schemeName);
KUrl file = KUrl::fromLocalFile(KGlobal::dirs()->findResource("appdata", relPath));
QUrl file = QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, relPath));
QXmlSchema schema;
if (schema.load(file) == false) {
kWarning() << "Schema at file " << file.toLocalFile() << " is invalid.";
qWarning() << "Schema at file " << file.toLocalFile() << " is invalid.";
}
return schema;
}
QDomDocument TestLanguageFiles::loadDomDocument(const KUrl &path, const QXmlSchema &schema) const
QDomDocument TestLanguageFiles::loadDomDocument(const QUrl &path, const QXmlSchema &schema) const
{
QDomDocument document;
QXmlSchemaValidator validator(schema);
if (!validator.validate(path)) {
kWarning() << "Schema is not valid, aborting loading of XML document:" << path.toLocalFile();
qWarning() << "Schema is not valid, aborting loading of XML document:" << path.toLocalFile();
return document;
}
......@@ -79,17 +80,17 @@ QDomDocument TestLanguageFiles::loadDomDocument(const KUrl &path, const QXmlSche
QFile file(path.toLocalFile());
if (file.open(QIODevice::ReadOnly)) {
if (!document.setContent(&file, &errorMsg)) {
kWarning() << errorMsg;
qWarning() << errorMsg;
}
} else {
kWarning() << "Could not open XML document " << path.toLocalFile() << " for reading, aborting.";
qWarning() << "Could not open XML document " << path.toLocalFile() << " for reading, aborting.";
}
return document;
}
void TestLanguageFiles::languageSchemeValidationTest()
{
KUrl languageFile = KUrl::fromLocalFile("schemes/language.xsd");
QUrl languageFile = QUrl::fromLocalFile("schemes/language.xsd");
QXmlSchema languageSchema;
QVERIFY(languageSchema.load(languageFile));
QVERIFY(languageSchema.isValid());
......@@ -98,11 +99,11 @@ void TestLanguageFiles::languageSchemeValidationTest()
void TestLanguageFiles::checkIdUniqueness()
{
ResourceManager manager;
QStringList languageFiles = KGlobal::dirs()->findAllResources("appdata",QString("data/languages/*.xml"));
QStringList languageFiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, QString("data/languages/*.xml"));
foreach (const QString &file, languageFiles) {
kDebug() << "File being parsed: " << file;
qDebug() << "File being parsed: " << file;
QStringList idList;
const KUrl &languageFile = KUrl::fromLocalFile(file);
const QUrl &languageFile = QUrl::fromLocalFile(file);
QVERIFY(languageFile.isLocalFile());
QXmlSchema schema = loadXmlSchema("language");
......@@ -126,7 +127,7 @@ void TestLanguageFiles::checkIdUniqueness()
phonemeNode = phonemeNode.nextSiblingElement())
{
QString id = phonemeNode.firstChildElement("id").text();
kDebug() << "ID: " << id;
qDebug() << "ID: " << id;
QVERIFY2(!idList.contains(id),"Phoneme ID used more than once in the tested file");
idList.append(id);
}
......@@ -135,4 +136,4 @@ void TestLanguageFiles::checkIdUniqueness()
}
QTEST_KDEMAIN_CORE(TestLanguageFiles)
QTEST_MAIN(TestLanguageFiles)
......@@ -25,7 +25,7 @@
class QXmlSchema;
class QDomDocument;
class KUrl;
class QUrl;
class TestLanguageFiles : public QObject
{
......@@ -72,7 +72,7 @@ private:
* \param scheme is the XML schema describing the DOM
* \return the loaded DOM document
*/
QDomDocument loadDomDocument(const KUrl &path, const QXmlSchema &schema) const;
QDomDocument loadDomDocument(const QUrl &path, const QXmlSchema &schema) const;
};
#endif
/*
* Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* 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) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
// define with 0/1 value
#cmakedefine01 QTGSTREAMER_FOUND
#cmakedefine01 QTMOBILITY_FOUND
#endif
......@@ -23,5 +23,5 @@
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###
add_subdirectory(languages)
ecm_optional_add_subdirectory(languages)
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR artikulate)
###
# Copyright 2013-2014 Andreas Cord-Landwehr <cordlandwehr@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR artikulate)
<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [
<!ENTITY artikulate "Artikulate">
<!ENTITY kappname "&artikulate;">
......@@ -33,8 +33,8 @@
<copyright><year>2014</year><holder>The &artikulate; Developers</holder></copyright>
<date>2014-03-15</date>
<releaseinfo>0.3.0 &kde; 4.13</releaseinfo>
<date>2015-09-27</date>
<releaseinfo>&artikulate; 0.5.0 (Applications 15.12)</releaseinfo>
<legalnotice>&FDLNotice;</legalnotice>
......
###
# Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
# Copyright 2013-2014 Andreas Cord-Landwehr <cordlandwehr@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
......@@ -23,7 +23,18 @@
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###
add_subdirectory(actions)
ecm_optional_add_subdirectory(actions)
ecm_install_icons(
ICONS
16-apps-artikulate.png
32-apps-artikulate.png
48-apps-artikulate.png
64-apps-artikulate.png
sc-apps-artikulate.svgz
DESTINATION ${ICON_INSTALL_DIR}
THEME hicolor
)
kde4_install_icons(${ICON_INSTALL_DIR})
kde4_update_iconcache()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment