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

KUrl -> QUrl.

parent 3dd5781a
......@@ -65,12 +65,12 @@ void TestCourseFiles::cleanup()
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,8 +79,8 @@ 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);
......@@ -89,8 +89,8 @@ void TestCourseFiles::fileLoadSaveCompleteness()
KTemporaryFile outputFile;
outputFile.setSuffix(".xml");
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
......@@ -101,7 +101,7 @@ void TestCourseFiles::fileLoadSaveCompleteness()
}
//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
......
......@@ -29,7 +29,7 @@
#include <QDebug>
#include <KTemporaryFile>
#include <KStandardDirs>
#include <KUrl>
#include <QUrl>
#include <QIODevice>
#include <QFile>
......@@ -57,7 +57,7 @@ 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(KGlobal::dirs()->findResource("appdata", relPath));
QXmlSchema schema;
if (schema.load(file) == false) {
......@@ -66,7 +66,7 @@ QXmlSchema TestLanguageFiles::loadXmlSchema(const QString &schemeName) const
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);
......@@ -89,7 +89,7 @@ QDomDocument TestLanguageFiles::loadDomDocument(const KUrl &path, const QXmlSche
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());
......@@ -102,7 +102,7 @@ void TestLanguageFiles::checkIdUniqueness()
foreach (const QString &file, languageFiles) {
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");
......
......@@ -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
......@@ -62,7 +62,7 @@ int ProfileManager::profileCount() const
void ProfileManager::openImageFileDialog()
{
KUrl imageUrl = KFileDialog::getImageOpenUrl();
QUrl imageUrl = KFileDialog::getImageOpenUrl();
d->m_activeProfile->importImage(imageUrl.toLocalFile());
}
......
......@@ -26,7 +26,7 @@
#include <QObject>
class CaptureDeviceControllerPrivate;
class KUrl;
class QUrl;
/**
* \class CaptureDeviceController
......
......@@ -20,7 +20,7 @@
#include "outputdevicecontroller.h"
#include "qtgstreameroutputbackend.h"
#include <KUrl>
#include <QUrl>
#include <QDebug>
/**
......@@ -96,7 +96,7 @@ void OutputDeviceController::play(const QString& filePath)
emit started();
}
void OutputDeviceController::play(const KUrl &filePath)
void OutputDeviceController::play(const QUrl &filePath)
{
play(filePath.toLocalFile());
}
......
......@@ -25,7 +25,7 @@
#include <QObject>
class OutputDeviceControllerPrivate;
class KUrl;
class QUrl;
/**
* \class OutputDeviceController
......@@ -53,7 +53,7 @@ public:
static OutputDeviceController & self();
void play(const QString &filePath);
void play(const KUrl &filePath);
void play(const QUrl &filePath);
OutputDeviceController::State state() const;
void stop();
QString currentSource() const;
......
......@@ -128,12 +128,12 @@ void Course::setLanguage(Language *language)
emit languageChanged();
}
KUrl Course::file() const
QUrl Course::file() const
{
return m_file;
}
void Course::setFile(const KUrl &file)
void Course::setFile(const QUrl &file)
{
m_file = file;
}
......
......@@ -24,7 +24,7 @@
#include "artikulatecore_export.h"
#include <QObject>
#include <QMap>
#include <KUrl>
#include <QUrl>
class ResourceInterface;
class CourseResource;
......@@ -57,8 +57,8 @@ public:
void setLanguage(Language *language);
QString description() const;
void setDescription(const QString &description);
KUrl file() const;
void setFile(const KUrl &file);
QUrl file() const;
void setFile(const QUrl &file);
QList<Unit *> unitList() const;
QList<Unit *> phonemeUnitList(PhonemeGroup *phonemeGroup) const;
/**
......@@ -128,7 +128,7 @@ private:
QString m_title;
QString m_description;
Language *m_language;
KUrl m_file;
QUrl m_file;
bool m_modified;
QList<Unit *> m_unitList;
QList<PhonemeGroup *> m_phonemeGroupList;
......
......@@ -76,12 +76,12 @@ void Language::seti18nTitle(const QString &title)
emit i18nTitleChanged();
}
KUrl Language::file() const
QUrl Language::file() const
{
return m_file;
}
void Language::setFile(const KUrl& file)
void Language::setFile(const QUrl &file)
{
m_file = file;
}
......
......@@ -24,7 +24,7 @@
#include "artikulatecore_export.h"
#include <QObject>
#include <QList>
#include <KUrl>
#include <QUrl>
class QString;
class Phoneme;
......@@ -47,8 +47,8 @@ public:
void seti18nTitle(const QString &title);
QString i18nTitle() const;
void setTitle(const QString &title);
KUrl file() const;
void setFile(const KUrl &file);
QUrl file() const;
void setFile(const QUrl &file);
QList<Phoneme *> phonemes() const;
Phoneme * addPhoneme(const QString &identifier, const QString &title);
QList<PhonemeGroup *> phonemeGroups() const;
......@@ -67,7 +67,7 @@ private:
QString m_id;
QString m_title;
QString m_i18nTitle;
KUrl m_file;
QUrl m_file;
QList<PhonemeGroup *> m_phonemeGroups;
};
......
......@@ -222,12 +222,12 @@ void Phrase::setUnit(Unit *unit)
emit unitChanged();
}
KUrl Phrase::sound() const
QUrl Phrase::sound() const
{
return m_nativeSoundFile;
}
void Phrase::setSound(const KUrl &soundFile)
void Phrase::setSound(const QUrl &soundFile)
{
if (!soundFile.isValid() || soundFile.isEmpty()) {
qWarning() << "Not setting empty sound file path.";
......@@ -245,7 +245,7 @@ QString Phrase::soundFileUrl() const
QString Phrase::soundFileOutputPath() const
{
if (m_nativeSoundFile.isEmpty()) {
QString outputDir = m_unit->course()->file().directory(KUrl::AppendTrailingSlash);
QString outputDir = m_unit->course()->file().directory(QUrl::AppendTrailingSlash);
//TODO take care that this is proper ASCII
return outputDir + id() + ".ogg";
} else {
......@@ -256,7 +256,7 @@ QString Phrase::soundFileOutputPath() const
void Phrase::setSoundFileUrl()
{
if (soundFileOutputPath() != m_nativeSoundFile.toLocalFile()) {
m_nativeSoundFile = KUrl::fromLocalFile(soundFileOutputPath());
m_nativeSoundFile = QUrl::fromLocalFile(soundFileOutputPath());
emit soundChanged();
emit modified();
}
......
......@@ -24,14 +24,14 @@
#include "artikulatecore_export.h"
#include <QObject>
#include <KUrl>
#include <QUrl>
#include <QList>
#include <KTemporaryFile>
class QString;
class Phoneme;
class Unit;
class KUrl;
class QUrl;
class ARTIKULATELIB_EXPORT Phrase : public QObject
{
......@@ -92,8 +92,8 @@ public:
void setEditState(const QString &stateString);
Phrase::TrainingState trainingState() const;
void setTrainingState(Phrase::TrainingState state);
KUrl sound() const;
void setSound(const KUrl &soundFile);
QUrl sound() const;
void setSound(const QUrl &soundFile);
QList<Phoneme *> phonemes() const;
bool isExcluded() const;
void setExcluded(bool excluded = false);
......@@ -127,7 +127,7 @@ private:
Unit *m_unit;
bool m_excludedFromUnit;
QList<Phoneme *> m_phonemes;
KUrl m_nativeSoundFile;
QUrl m_nativeSoundFile;
};
#endif // PHRASE_H
......@@ -23,7 +23,7 @@
#include <QList>
#include <QDebug>
#include <KUrl>
#include <QUrl>
#include <QString>
Player::Player(QObject *parent)
......@@ -39,7 +39,7 @@ Player::~Player()
// nothing to do
}
void Player::setSoundFile(const KUrl &fileUrl)
void Player::setSoundFile(const QUrl &fileUrl)
{
if (!fileUrl.isValid() || fileUrl.isEmpty()) {
qWarning() << "Not setting empty sound file path.";
......@@ -52,7 +52,7 @@ void Player::setSoundFile(const KUrl &fileUrl)
void Player::setSoundFile(const QString& fileUrl)
{
OutputDeviceController::self().stop();
setSoundFile(KUrl::fromLocalFile(fileUrl));
setSoundFile(QUrl::fromLocalFile(fileUrl));
}
QString Player::soundFile() const
......@@ -73,7 +73,7 @@ void Player::playback()
return;
}
qDebug() << this << "Playback sound in file "<< m_soundFile.toLocalFile();
OutputDeviceController::self().play(KUrl::fromLocalFile(m_soundFile.toLocalFile()));
OutputDeviceController::self().play(QUrl::fromLocalFile(m_soundFile.toLocalFile()));
m_playbackState = PlayingState;
connect(&OutputDeviceController::self(), SIGNAL(started()), this, SLOT(updateState()));
connect(&OutputDeviceController::self(), SIGNAL(stopped()), this, SLOT(updateState()));
......
......@@ -23,7 +23,7 @@
#include "artikulatecore_export.h"
#include <QObject>
#include <KUrl>
#include <QUrl>
class ARTIKULATELIB_EXPORT Player : public QObject
{
......@@ -45,7 +45,7 @@ public:
Q_INVOKABLE void playback();
Q_INVOKABLE void stop();
PlaybackState state() const;
void setSoundFile(const KUrl &fileUrl);
void setSoundFile(const QUrl &fileUrl);
void setSoundFile(const QString &fileUrl);
QString soundFile() const;
......@@ -58,7 +58,7 @@ private Q_SLOTS:
private:
Q_DISABLE_COPY(Player)
KUrl m_soundFile;
QUrl m_soundFile;
PlaybackState m_playbackState;
};
......
......@@ -26,7 +26,7 @@
#include "phrase.h"
#include <QObject>
#include <QList>
#include <KUrl>
#include <QUrl>
class QString;
class Language;
......
......@@ -23,7 +23,7 @@
#include <QList>
#include <QDebug>
#include <KUrl>
#include <QUrl>
#include <QString>
Recorder::Recorder(QObject *parent)
......
......@@ -23,7 +23,7 @@
#include "artikulatecore_export.h"
#include <QObject>
#include <KUrl>
#include <QUrl>
#include <KTemporaryFile>
class ARTIKULATELIB_EXPORT Recorder : public QObject
......
......@@ -46,7 +46,7 @@
#include <KGlobal>
#include <KStandardDirs>
#include <QDebug>
#include <KUrl>
#include <QUrl>
ResourceManager::ResourceManager(QObject *parent)
: QObject(parent)
......@@ -69,7 +69,7 @@ void ResourceManager::loadCourseResources()
QFileInfoList list = skeletonRepository.entryInfoList();
for (int i = 0; i < list.size(); ++i) {
QFileInfo fileInfo = list.at(i);
addSkeleton(KUrl::fromLocalFile(fileInfo.absoluteFilePath()));
addSkeleton(QUrl::fromLocalFile(fileInfo.absoluteFilePath()));
}
}
......@@ -112,10 +112,10 @@ void ResourceManager::loadCourseResources()
// register GHNS course resources
QStringList courseFiles = KGlobal::dirs()->findAllResources("data",QString("artikulate/courses/*/*/*.xml"));
foreach (const QString &file, courseFiles) {
KUrl courseFile = KUrl::fromLocalFile(file);
QUrl courseFile = QUrl::fromLocalFile(file);
// get directory name, which is the language identifier for this course
// TODO allow usage of non-language ID named course folders
QString directory = courseFile.directory().section('/', -1);
QString directory = courseFile.adjusted(QUrl::RemoveFilename|QUrl::StripTrailingSlash).path().section('/', -1);
addCourse(courseFile);
}
......@@ -130,7 +130,7 @@ void ResourceManager::loadLanguageResources()
// all other resources are only loaded on demand
QStringList languageFiles = KGlobal::dirs()->findAllResources("appdata",QString("languages/*.xml"));
foreach (const QString &file, languageFiles) {
addLanguage(KUrl::fromLocalFile(file));
addLanguage(QUrl::fromLocalFile(file));
}
}
......@@ -145,7 +145,7 @@ void ResourceManager::registerLearningGoals(LearnerProfile::ProfileManager *prof
}
}
void ResourceManager::addLanguage(const KUrl &languageFile)
void ResourceManager::addLanguage(const QUrl &languageFile)
{
if (m_loadedResources.contains(languageFile.toLocalFile())) {
return;
......@@ -230,7 +230,7 @@ void ResourceManager::reloadCourseOrSkeleton(Course *courseOrSkeleton)
if (courseOrSkeleton->language()) { // only course files have a language
//TODO better add a check if this is contained in the course list
// to catch possible errors
KUrl file = courseOrSkeleton->file();
QUrl file = courseOrSkeleton->file();
m_loadedResources.removeOne(courseOrSkeleton->file().toLocalFile());
removeCourse(courseOrSkeleton);
addCourse(file);
......@@ -318,7 +318,7 @@ void ResourceManager::updateCourseFromSkeleton(Course *course)
qDebug() << "Update performed!";
}
CourseResource * ResourceManager::addCourse(const KUrl &courseFile)
CourseResource * ResourceManager::addCourse(const QUrl &courseFile)
{
CourseResource *resource = new CourseResource(this, courseFile);
if (resource->language().isEmpty()) {
......@@ -377,7 +377,7 @@ void ResourceManager::newCourseDialog(Language *language)
}
}
void ResourceManager::addSkeleton(const KUrl &skeletonFile)
void ResourceManager::addSkeleton(const QUrl &skeletonFile)
{
SkeletonResource *resource = new SkeletonResource(this, skeletonFile);
addSkeletonResource(resource);
......
......@@ -36,7 +36,7 @@ class Skeleton;
class Language;
class Course;
class ProfileManager;
class KUrl;
class QUrl;
class QDomDocument;
class QFile;
class QXmlSchema;
......@@ -124,7 +124,7 @@ public:
*
* \param languageFile is the local XML file containing the language
*/
void addLanguage(const KUrl &languageFile);
void addLanguage(const QUrl &languageFile);
/**
* Adds course to resource manager by parsing the given course specification file.
......@@ -132,7 +132,7 @@ public:
* \param courseFile is the local XML file containing the course
* \return true if loaded successfully, otherwise false
*/
CourseResource * addCourse(const KUrl &courseFile);
CourseResource * addCourse(const QUrl &courseFile);
/**
* Adds course to resource manager. If the course's language is not registered, the language
......@@ -155,7 +155,7 @@ public:
*
* \param resource the skeleton resource to add to resource manager
*/
void addSkeleton(const KUrl &skeletonFile);
void addSkeleton(const QUrl &skeletonFile);
/**
* Adds skeleton resource to resource manager
......
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