aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cord-Landwehr <[email protected]>2014-08-10 10:40:28 +0200
committerAndreas Cord-Landwehr <[email protected]>2014-08-10 10:40:28 +0200
commitf57167210309cb37629c39841301953bd88ac0dc (patch)
tree66d7f5799862528aac1faebb44e77b8fbaffb6af
parent3dd5781aa53a0f4991949dc8a9d168f433f8573f (diff)
KUrl -> QUrl.
-rw-r--r--autotests/testcoursefiles.cpp14
-rw-r--r--autotests/testlanguagefiles.cpp10
-rw-r--r--autotests/testlanguagefiles.h4
-rw-r--r--liblearnerprofile/src/profilemanager.cpp2
-rw-r--r--libsound/src/capturedevicecontroller.h2
-rw-r--r--libsound/src/outputdevicecontroller.cpp4
-rw-r--r--libsound/src/outputdevicecontroller.h4
-rw-r--r--src/core/course.cpp4
-rw-r--r--src/core/course.h8
-rw-r--r--src/core/language.cpp4
-rw-r--r--src/core/language.h8
-rw-r--r--src/core/phrase.cpp8
-rw-r--r--src/core/phrase.h10
-rw-r--r--src/core/player.cpp8
-rw-r--r--src/core/player.h6
-rw-r--r--src/core/profile.h2
-rw-r--r--src/core/recorder.cpp2
-rw-r--r--src/core/recorder.h2
-rw-r--r--src/core/resourcemanager.cpp18
-rw-r--r--src/core/resourcemanager.h8
-rw-r--r--src/core/resources/courseresource.cpp11
-rw-r--r--src/core/resources/courseresource.h4
-rw-r--r--src/core/resources/languageresource.cpp6
-rw-r--r--src/core/resources/languageresource.h4
-rw-r--r--src/core/resources/resourceinterface.cpp6
-rw-r--r--src/core/resources/resourceinterface.h6
-rw-r--r--src/core/resources/skeletonresource.cpp9
-rw-r--r--src/core/resources/skeletonresource.h4
-rw-r--r--src/core/skeleton.h2
-rw-r--r--src/core/unit.cpp2
-rw-r--r--src/models/phrasefiltermodel.cpp2
-rw-r--r--src/ui/newcoursedialog.cpp4
-rw-r--r--src/ui/sounddevicedialogpage.cpp4
33 files changed, 97 insertions, 95 deletions
diff --git a/autotests/testcoursefiles.cpp b/autotests/testcoursefiles.cpp
index 1dd4f81..3c9cc5a 100644
--- a/autotests/testcoursefiles.cpp
+++ b/autotests/testcoursefiles.cpp
@@ -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
diff --git a/autotests/testlanguagefiles.cpp b/autotests/testlanguagefiles.cpp
index 598954a..028289e 100644
--- a/autotests/testlanguagefiles.cpp
+++ b/autotests/testlanguagefiles.cpp
@@ -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");
diff --git a/autotests/testlanguagefiles.h b/autotests/testlanguagefiles.h
index b8c2542..5ac3754 100644
--- a/autotests/testlanguagefiles.h
+++ b/autotests/testlanguagefiles.h
@@ -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
diff --git a/liblearnerprofile/src/profilemanager.cpp b/liblearnerprofile/src/profilemanager.cpp
index 03984b3..4720a68 100644
--- a/liblearnerprofile/src/profilemanager.cpp
+++ b/liblearnerprofile/src/profilemanager.cpp
@@ -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());
}
diff --git a/libsound/src/capturedevicecontroller.h b/libsound/src/capturedevicecontroller.h
index 3d49acf..af9696f 100644
--- a/libsound/src/capturedevicecontroller.h
+++ b/libsound/src/capturedevicecontroller.h
@@ -26,7 +26,7 @@
#include <QObject>
class CaptureDeviceControllerPrivate;
-class KUrl;
+class QUrl;
/**
* \class CaptureDeviceController
diff --git a/libsound/src/outputdevicecontroller.cpp b/libsound/src/outputdevicecontroller.cpp
index c056ea9..51db872 100644
--- a/libsound/src/outputdevicecontroller.cpp
+++ b/libsound/src/outputdevicecontroller.cpp
@@ -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());
}
diff --git a/libsound/src/outputdevicecontroller.h b/libsound/src/outputdevicecontroller.h
index 82d5031..a01a520 100644
--- a/libsound/src/outputdevicecontroller.h
+++ b/libsound/src/outputdevicecontroller.h
@@ -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;
diff --git a/src/core/course.cpp b/src/core/course.cpp
index 5fe55f5..d03104b 100644
--- a/src/core/course.cpp
+++ b/src/core/course.cpp
@@ -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;
}
diff --git a/src/core/course.h b/src/core/course.h
index 64f143a..3eaa890 100644
--- a/src/core/course.h
+++ b/src/core/course.h
@@ -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;
diff --git a/src/core/language.cpp b/src/core/language.cpp
index b3d0142..42a9e04 100644
--- a/src/core/language.cpp
+++ b/src/core/language.cpp
@@ -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;
}
diff --git a/src/core/language.h b/src/core/language.h
index 92b8bbd..b6a9376 100644
--- a/src/core/language.h
+++ b/src/core/language.h
@@ -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;
};
diff --git a/src/core/phrase.cpp b/src/core/phrase.cpp
index 98a3519..22c02ce 100644
--- a/src/core/phrase.cpp
+++ b/src/core/phrase.cpp
@@ -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();
}
diff --git a/src/core/phrase.h b/src/core/phrase.h
index 7fbc5f1..35c0744 100644
--- a/src/core/phrase.h
+++ b/src/core/phrase.h
@@ -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
diff --git a/src/core/player.cpp b/src/core/player.cpp
index fff813b..2837608 100644
--- a/src/core/player.cpp
+++ b/src/core/player.cpp
@@ -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()));
diff --git a/src/core/player.h b/src/core/player.h
index a0989c7..330b70a 100644
--- a/src/core/player.h
+++ b/src/core/player.h
@@ -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;
};
diff --git a/src/core/profile.h b/src/core/profile.h
index 41be04f..14a32a1 100644
--- a/src/core/profile.h
+++ b/src/core/profile.h
@@ -26,7 +26,7 @@
#include "phrase.h"
#include <QObject>
#include <QList>
-#include <KUrl>
+#include <QUrl>
class QString;
class Language;
diff --git a/src/core/recorder.cpp b/src/core/recorder.cpp
index b2d59b7..522577e 100644
--- a/src/core/recorder.cpp
+++ b/src/core/recorder.cpp
@@ -23,7 +23,7 @@
#include <QList>
#include <QDebug>
-#include <KUrl>
+#include <QUrl>
#include <QString>
Recorder::Recorder(QObject *parent)
diff --git a/src/core/recorder.h b/src/core/recorder.h
index 3556e49..4e9f3f4 100644
--- a/src/core/recorder.h
+++ b/src/core/recorder.h
@@ -23,7 +23,7 @@
#include "artikulatecore_export.h"
#include <QObject>
-#include <KUrl>
+#include <QUrl>
#include <KTemporaryFile>
class ARTIKULATELIB_EXPORT Recorder : public QObject
diff --git a/src/core/resourcemanager.cpp b/src/core/resourcemanager.cpp
index b57d6aa..644094a 100644
--- a/src/core/resourcemanager.cpp
+++ b/src/core/resourcemanager.cpp
@@ -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);
diff --git a/src/core/resourcemanager.h b/src/core/resourcemanager.h
index d1b21fb..cbf705f 100644
--- a/src/core/resourcemanager.h
+++ b/src/core/resourcemanager.h
@@ -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
diff --git a/src/core/resources/courseresource.cpp b/src/core/resources/courseresource.cpp
index 8183c19..067a3ea 100644
--- a/src/core/resources/courseresource.cpp
+++ b/src/core/resources/courseresource.cpp
@@ -52,7 +52,7 @@ public:
}
ResourceManager *m_resourceManager;
- KUrl m_path;
+ QUrl m_path;
ResourceInterface::Type m_type;
QString m_identifier;
QString m_title;
@@ -61,7 +61,7 @@ public:
Course *m_courseResource;
};
-CourseResource::CourseResource(ResourceManager *resourceManager, const KUrl &path)
+CourseResource::CourseResource(ResourceManager *resourceManager, const QUrl &path)
: ResourceInterface(resourceManager)
, d(new CourseResourcePrivate(resourceManager))
{
@@ -237,7 +237,8 @@ void CourseResource::sync()
//TODO port to KSaveFile
QFile file;
- file.setFileName(path().toLocalFile());
+ file = file.adjusted(QUrl::RemoveFilename);
+ file.setPath(file.path() + path().toLocalFile());
if (!file.open(QIODevice::WriteOnly)) {
qWarning() << "Unable to open file " << file.fileName() << " in write mode, aborting.";
return;
@@ -305,7 +306,7 @@ bool CourseResource::isOpen() const
return (d->m_courseResource != 0);
}
-KUrl CourseResource::path() const
+QUrl CourseResource::path() const
{
if (d->m_courseResource) {
return d->m_courseResource->file();
@@ -406,7 +407,7 @@ Phrase* CourseResource::parsePhrase(QDomElement phraseNode, Unit* parentUnit) co
phrase->seti18nText(phraseNode.firstChildElement("i18nText").text());
phrase->setUnit(parentUnit);
if (!phraseNode.firstChildElement("soundFile").text().isEmpty()) {
- phrase->setSound(KUrl::fromLocalFile(
+ phrase->setSound(QUrl::fromLocalFile(
path().directory() + '/' + phraseNode.firstChildElement("soundFile").text())
);
}
diff --git a/src/core/resources/courseresource.h b/src/core/resources/courseresource.h
index c762a83..ec26a0d 100644
--- a/src/core/resources/courseresource.h
+++ b/src/core/resources/courseresource.h
@@ -41,7 +41,7 @@ public:
/**
* Create course resource from file.
*/
- explicit CourseResource(ResourceManager *resourceManager, const KUrl &path);
+ explicit CourseResource(ResourceManager *resourceManager, const QUrl &path);
virtual ~CourseResource();
@@ -85,7 +85,7 @@ public:
/**
* \return path to resource file
*/
- virtual KUrl path() const;
+ virtual QUrl path() const;
/**
* \return reference to the loaded resource
diff --git a/src/core/resources/languageresource.cpp b/src/core/resources/languageresource.cpp
index 932a65b..97cbdf6 100644
--- a/src/core/resources/languageresource.cpp
+++ b/src/core/resources/languageresource.cpp
@@ -46,7 +46,7 @@ public:
}
ResourceManager *m_resourceManager;
- KUrl m_path;
+ QUrl m_path;
ResourceInterface::Type m_type;
QString m_identifier;
QString m_title;
@@ -54,7 +54,7 @@ public:
Language *m_languageResource;
};
-LanguageResource::LanguageResource(ResourceManager *resourceManager, const KUrl &path)
+LanguageResource::LanguageResource(ResourceManager *resourceManager, const QUrl &path)
: ResourceInterface(resourceManager)
, d(new LanguageResourcePrivate(resourceManager))
{
@@ -130,7 +130,7 @@ bool LanguageResource::isOpen() const
return (d->m_languageResource != 0);
}
-KUrl LanguageResource::path() const
+QUrl LanguageResource::path() const
{
return d->m_path;
}
diff --git a/src/core/resources/languageresource.h b/src/core/resources/languageresource.h
index 3525fc0..ab6c941 100644
--- a/src/core/resources/languageresource.h
+++ b/src/core/resources/languageresource.h
@@ -34,7 +34,7 @@ class ARTIKULATELIB_EXPORT LanguageResource : public ResourceInterface
Q_OBJECT
public:
- explicit LanguageResource(ResourceManager *resourceManager, const KUrl &path);
+ explicit LanguageResource(ResourceManager *resourceManager, const QUrl &path);
virtual ~LanguageResource();
@@ -71,7 +71,7 @@ public:
/**
* \return path to resource file
*/
- virtual KUrl path() const;
+ virtual QUrl path() const;
/**
* \return reference to the loaded resource
diff --git a/src/core/resources/resourceinterface.cpp b/src/core/resources/resourceinterface.cpp
index 65331f3..9dc0428 100644
--- a/src/core/resources/resourceinterface.cpp
+++ b/src/core/resources/resourceinterface.cpp
@@ -22,7 +22,7 @@
#include <QDebug>
#include <KStandardDirs>
-#include <KUrl>
+#include <QUrl>
#include <QIODevice>
#include <QXmlSchema>
@@ -65,7 +65,7 @@ void ResourceInterface::reload()
QXmlSchema ResourceInterface::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) {
@@ -74,7 +74,7 @@ QXmlSchema ResourceInterface::loadXmlSchema(const QString &schemeName) const
return schema;
}
-QDomDocument ResourceInterface::loadDomDocument(const KUrl &path, const QXmlSchema &schema) const
+QDomDocument ResourceInterface::loadDomDocument(const QUrl &path, const QXmlSchema &schema) const
{
QDomDocument document;
QXmlSchemaValidator validator(schema);
diff --git a/src/core/resources/resourceinterface.h b/src/core/resources/resourceinterface.h
index 4770e2c..e52c443 100644
--- a/src/core/resources/resourceinterface.h
+++ b/src/core/resources/resourceinterface.h
@@ -24,7 +24,7 @@
#include <QObject>
class ResourceManager;
-class KUrl;
+class QUrl;
class QXmlSchema;
class QDomDocument;
@@ -87,7 +87,7 @@ public:
/**
* \return path to resource file
*/
- virtual KUrl path() const = 0;
+ virtual QUrl path() const = 0;
/**
* Write changes to resource back to file.
@@ -122,7 +122,7 @@ public:
* \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;
private:
bool m_contributorResource; //!< identifies this resource as an editable resource
diff --git a/src/core/resources/skeletonresource.cpp b/src/core/resources/skeletonresource.cpp
index ab419c0..5e8509d 100644
--- a/src/core/resources/skeletonresource.cpp
+++ b/src/core/resources/skeletonresource.cpp
@@ -49,7 +49,7 @@ public:
}
ResourceManager *m_resourceManager;
- KUrl m_path;
+ QUrl m_path;
ResourceInterface::Type m_type;
QString m_identifier;
QString m_title;
@@ -57,7 +57,7 @@ public:
Skeleton *m_skeletonResource;
};
-SkeletonResource::SkeletonResource(ResourceManager *resourceManager, const KUrl &path)
+SkeletonResource::SkeletonResource(ResourceManager *resourceManager, const QUrl &path)
: ResourceInterface(resourceManager)
, d(new SkeletonResourcePrivate(resourceManager))
{
@@ -231,7 +231,8 @@ void SkeletonResource::sync()
// write back to file
//TODO port to KSaveFile
QFile file;
- file.setFileName(path().toLocalFile());
+ file = file.adjusted(QUrl::RemoveFilename);
+ file.setPath(file.path() + path().toLocalFile());
if (!file.open(QIODevice::WriteOnly)) {
qWarning() << "Unable to open file " << file.fileName() << " in write mode, aborting.";
return;
@@ -251,7 +252,7 @@ bool SkeletonResource::isOpen() const
return (d->m_skeletonResource != 0);
}
-KUrl SkeletonResource::path() const
+QUrl SkeletonResource::path() const
{
if (d->m_skeletonResource) {
return d->m_skeletonResource->file();
diff --git a/src/core/resources/skeletonresource.h b/src/core/resources/skeletonresource.h
index 8c6e99b..adcaf3e 100644
--- a/src/core/resources/skeletonresource.h
+++ b/src/core/resources/skeletonresource.h
@@ -38,7 +38,7 @@ public:
/**
* Create course resource from file.
*/
- explicit SkeletonResource(ResourceManager *resourceManager, const KUrl &path);
+ explicit SkeletonResource(ResourceManager *resourceManager, const QUrl &path);
/**
* Create course resource from course.
@@ -84,7 +84,7 @@ public:
/**
* \return path to resource file
*/
- virtual KUrl path() const;
+ virtual QUrl path() const;
/**
* \return reference to the loaded resource
diff --git a/src/core/skeleton.h b/src/core/skeleton.h
index 78f6dbb..4e12cdd 100644
--- a/src/core/skeleton.h
+++ b/src/core/skeleton.h
@@ -25,7 +25,7 @@
#include "course.h"
#include <QObject>
#include <QMap>
-#include <KUrl>
+#include <QUrl>
class ResourceInterface;
class SkeletonResource;
diff --git a/src/core/unit.cpp b/src/core/unit.cpp
index 9920096..fa31816 100644
--- a/src/core/unit.cpp
+++ b/src/core/unit.cpp
@@ -30,7 +30,7 @@
#include <QDebug>
#include <KLocale>
-#include <KUrl>
+#include <QUrl>
Unit::Unit(QObject *parent)
: QObject(parent)
diff --git a/src/models/phrasefiltermodel.cpp b/src/models/phrasefiltermodel.cpp
index 5274904..0fce046 100644
--- a/src/models/phrasefiltermodel.cpp
+++ b/src/models/phrasefiltermodel.cpp
@@ -108,7 +108,7 @@ bool PhraseFilterModel::filterAcceptsRow(int source_row, const QModelIndex &sour
int result = true;
if (m_hideNotRecorded || m_hideExcluded) {
QModelIndex index = sourceModel()->index(source_row, 0, source_parent);
- bool notRecorded = sourceModel()->data(index, PhraseModel::SoundFileRole).value<KUrl>().isEmpty();
+ bool notRecorded = sourceModel()->data(index, PhraseModel::SoundFileRole).value<QUrl>().isEmpty();
bool excluded = sourceModel()->data(index, PhraseModel::ExcludedRole).toBool();
result = !(notRecorded || excluded);
}
diff --git a/src/ui/newcoursedialog.cpp b/src/ui/newcoursedialog.cpp
index 869fc2e..199dd13 100644
--- a/src/ui/newcoursedialog.cpp
+++ b/src/ui/newcoursedialog.cpp
@@ -99,7 +99,7 @@ void NewCourseDialog::createCourse()
.arg(ui->identifier->text())
.arg(language->id());
- m_createdCourse = new CourseResource(m_resourceManager, KUrl::fromLocalFile(path));
+ m_createdCourse = new CourseResource(m_resourceManager, QUrl::fromLocalFile(path));
Q_ASSERT(m_createdCourse);
Course *course = m_createdCourse->course();
@@ -107,7 +107,7 @@ void NewCourseDialog::createCourse()
course->setId(QUuid::createUuid().toString());
course->setTitle(ui->title->text());
course->setDescription(ui->description->toHtml());
- course->setFile(KUrl::fromLocalFile(path));
+ course->setFile(QUrl::fromLocalFile(path));
course->setLanguage(language);
// set skeleton
diff --git a/src/ui/sounddevicedialogpage.cpp b/src/ui/sounddevicedialogpage.cpp
index 289f4dd..6823a98 100644
--- a/src/ui/sounddevicedialogpage.cpp
+++ b/src/ui/sounddevicedialogpage.cpp
@@ -101,7 +101,7 @@ void SoundDeviceDialogPage::playTestSound()
}
QString testsoundFile = KGlobal::dirs()->findResource("appdata", QString("sounds/testsound.ogg"));
OutputDeviceController::self().setVolume(ui->kcfg_AudioOutputVolume->value());
- OutputDeviceController::self().play(KUrl::fromLocalFile(testsoundFile));
+ OutputDeviceController::self().play(QUrl::fromLocalFile(testsoundFile));
}
void SoundDeviceDialogPage::playRecordedSound()
@@ -111,7 +111,7 @@ void SoundDeviceDialogPage::playRecordedSound()
return;
}
OutputDeviceController::self().setVolume(ui->kcfg_AudioOutputVolume->value());
- OutputDeviceController::self().play(KUrl::fromLocalFile(m_recordTestFile.fileName()));
+ OutputDeviceController::self().play(QUrl::fromLocalFile(m_recordTestFile.fileName()));
}
void SoundDeviceDialogPage::recordSound()