Commit 6ea15c25 authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr

Include frameworks.

parent 9496d3b9
......@@ -36,6 +36,8 @@ include(FeatureSummary)
find_package(Qt5 REQUIRED COMPONENTS
Widgets
Sql
XmlPatterns
)
find_package(KF5 CONFIG REQUIRED COMPONENTS
Config
......
......@@ -38,7 +38,7 @@ target_link_libraries(
LINK_PUBLIC
Qt5::Core
Qt5::Gui
KF5::Config
Qt5::Sql
KF5::KDELibs4Support
)
......
......@@ -47,7 +47,6 @@ target_link_libraries(
${QTGLIB_LIBRARY}
${QTGSTREAMER_LIBRARIES}
KF5::I18n
KF5::Config
)
set_target_properties(
......
......@@ -69,10 +69,10 @@ qt5_wrap_ui(artikulateCore_SRCS
kconfig_add_kcfg_files (artikulateCore_SRCS settings.kcfgc)
add_library(artikulatecore SHARED ${artikulateCore_SRCS})
target_link_libraries(artikulatecore
LINK_PRIVATE
LINK_PUBLIC
artikulatelearnerprofile
artikulatesound
KF5::Config
Qt5::XmlPatterns
${KDECLARATIVE_LIBRARIES}
${KDE4_KIO_LIBS}
${QT_QTDECLARATIVE_LIBRARY}
......
......@@ -176,7 +176,7 @@ Unit * Course::createUnit()
}
QString id = QUuid::createUuid().toString();
while (unitIds.contains(id)) {
id = QUuid::createUuid();
id = QUuid::createUuid().toString();
qWarning() << "Unit id generator has found a collision, recreating id.";
}
......@@ -201,7 +201,7 @@ Phrase * Course::createPhrase(Unit *unit)
}
QString id = QUuid::createUuid().toString();
while (phraseIds.contains(id)) {
id = QUuid::createUuid();
id = QUuid::createUuid().toString();
qWarning() << "Phrase id generator has found a collision, recreating id.";
}
......
......@@ -245,7 +245,7 @@ QString Phrase::soundFileUrl() const
QString Phrase::soundFileOutputPath() const
{
if (m_nativeSoundFile.isEmpty()) {
QString outputDir = m_unit->course()->file().directory(QUrl::AppendTrailingSlash);
QString outputDir = m_unit->course()->file().path() + '/';
//TODO take care that this is proper ASCII
return outputDir + id() + ".ogg";
} else {
......
......@@ -228,17 +228,15 @@ void CourseResource::sync()
root.appendChild(unitListElement);
// write back to file
QFileInfo info(path().directory()); // create directories if necessary
QFileInfo info(path().path()); // create directories if necessary
if (!info.exists()) {
qDebug() << "create xml output file directory, not existing";
QDir dir;
dir.mkpath(path().directory());
dir.mkpath(path().path());
}
//TODO port to KSaveFile
QFile file;
file = file.adjusted(QUrl::RemoveFilename);
file.setPath(file.path() + path().toLocalFile());
QFile file(path().toLocalFile());
if (!file.open(QIODevice::WriteOnly)) {
qWarning() << "Unable to open file " << file.fileName() << " in write mode, aborting.";
return;
......@@ -408,7 +406,7 @@ Phrase* CourseResource::parsePhrase(QDomElement phraseNode, Unit* parentUnit) co
phrase->setUnit(parentUnit);
if (!phraseNode.firstChildElement("soundFile").text().isEmpty()) {
phrase->setSound(QUrl::fromLocalFile(
path().directory() + '/' + phraseNode.firstChildElement("soundFile").text())
path().path() + '/' + phraseNode.firstChildElement("soundFile").text())
);
}
phrase->setType(phraseNode.firstChildElement("type").text());
......
......@@ -230,9 +230,7 @@ void SkeletonResource::sync()
// write back to file
//TODO port to KSaveFile
QFile file;
file = file.adjusted(QUrl::RemoveFilename);
file.setPath(file.path() + path().toLocalFile());
QFile file(path().toLocalFile());
if (!file.open(QIODevice::WriteOnly)) {
qWarning() << "Unable to open file " << file.fileName() << " in write mode, aborting.";
return;
......
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