Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a415cb4e authored by Lukas Appelhans's avatar Lukas Appelhans

Do a lot of KUrl->QUrl porting again

parent 198be2ed
......@@ -41,7 +41,7 @@
#include <QDomElement>
Metalink::Metalink(TransferGroup * parent, TransferFactory * factory,
Scheduler * scheduler, const KUrl & source, const KUrl & dest,
Scheduler * scheduler, const QUrl & source, const QUrl & dest,
const QDomElement * e)
: Transfer(parent, factory, scheduler, source, dest, e),
m_fileModel(0),
......@@ -83,10 +83,10 @@ void Metalink::downloadMetalink()
setStatus(Job::Stopped, i18n("Downloading Metalink File...."), SmallIcon("document-save"));
setTransferChange(Tc_Status, true);
Download *download = new Download(m_source, QString(KStandardDirs::locateLocal("appdata", "metalinks/") + m_source.fileName()));
connect(download, SIGNAL(finishedSuccessfully(KUrl,QByteArray)), SLOT(metalinkInit(KUrl,QByteArray)));
connect(download, SIGNAL(finishedSuccessfully(QUrl,QByteArray)), SLOT(metalinkInit(QUrl,QByteArray)));
}
bool Metalink::metalinkInit(const KUrl &src, const QByteArray &data)
bool Metalink::metalinkInit(const QUrl &src, const QByteArray &data)
{
qCDebug(KGET_DEBUG);
......@@ -127,8 +127,8 @@ bool Metalink::metalinkInit(const KUrl &src, const QByteArray &data)
QList<KGetMetalink::File>::const_iterator itEnd = m_metalink.files.files.constEnd();
m_totalSize = 0;
KIO::fileoffset_t segSize = 500 * 1024;//TODO use config here!
const KUrl tempDest = KUrl(m_dest.directory());
KUrl dest;
const QUrl tempDest = QUrl(m_dest.directory());
QUrl dest;
for (it = m_metalink.files.files.constBegin(); it != itEnd ; ++it)
{
dest = tempDest;
......@@ -146,7 +146,7 @@ bool Metalink::metalinkInit(const KUrl &src, const QByteArray &data)
dataFactory->setMaxMirrorsUsed(MetalinkSettings::mirrorsPerFile());
#ifdef HAVE_NEPOMUK
nepomukHandler()->setProperties((*it).properties(), QList<KUrl>() << dest);
nepomukHandler()->setProperties((*it).properties(), QList<QUrl>() << dest);
#endif //HAVE_NEPOMUK
//TODO compare available file size (<size>) with the sizes of the server while downloading?
......@@ -160,7 +160,7 @@ bool Metalink::metalinkInit(const KUrl &src, const QByteArray &data)
//add the DataSources
for (int i = 0; i < urlList.size(); ++i)
{
const KUrl url = urlList[i].url;
const QUrl url = urlList[i].url;
if (url.isValid())
{
dataFactory->addMirror(url, MetalinkSettings::connectionsPerUrl());
......@@ -533,7 +533,7 @@ void Metalink::slotSignatureVerified()
}
}
bool Metalink::repair(const KUrl &file)
bool Metalink::repair(const QUrl &file)
{
if (file.isValid())
{
......@@ -580,7 +580,7 @@ void Metalink::load(const QDomElement *element)
}
const QDomElement e = *element;
m_localMetalinkLocation = KUrl(e.attribute("LocalMetalinkLocation"));
m_localMetalinkLocation = QUrl(e.attribute("LocalMetalinkLocation"));
QDomNodeList factories = e.firstChildElement("factories").elementsByTagName("factory");
//no stored information found, stop right here
......@@ -633,7 +633,7 @@ void Metalink::save(const QDomElement &element)
}
}
Verifier *Metalink::verifier(const KUrl &file)
Verifier *Metalink::verifier(const QUrl &file)
{
if (!m_dataSourceFactory.contains(file))
{
......@@ -643,7 +643,7 @@ Verifier *Metalink::verifier(const KUrl &file)
return m_dataSourceFactory[file]->verifier();
}
Signature *Metalink::signature(const KUrl &file)
Signature *Metalink::signature(const QUrl &file)
{
if (!m_dataSourceFactory.contains(file)) {
return 0;
......@@ -652,7 +652,7 @@ Signature *Metalink::signature(const KUrl &file)
return m_dataSourceFactory[file]->signature();
}
QList<KUrl> Metalink::files() const
QList<QUrl> Metalink::files() const
{
return m_dataSourceFactory.keys();
}
......@@ -662,12 +662,12 @@ FileModel *Metalink::fileModel()
if (!m_fileModel)
{
m_fileModel = new FileModel(files(), directory(), this);
connect(m_fileModel, SIGNAL(rename(KUrl,KUrl)), this, SLOT(slotRename(KUrl,KUrl)));
connect(m_fileModel, SIGNAL(rename(QUrl,QUrl)), this, SLOT(slotRename(QUrl,QUrl)));
connect(m_fileModel, SIGNAL(checkStateChanged()), this, SLOT(filesSelected()));
foreach (DataSourceFactory *factory, m_dataSourceFactory)
{
const KUrl dest = factory->dest();
const QUrl dest = factory->dest();
QModelIndex size = m_fileModel->index(dest, FileItem::Size);
m_fileModel->setData(size, static_cast<qlonglong>(factory->size()));
QModelIndex status = m_fileModel->index(dest, FileItem::Status);
......@@ -699,7 +699,7 @@ void Metalink::filesSelected()
//and asks the user if there are existing files already
foreach (const QModelIndex &index, files)
{
const KUrl dest = fileModel()->getUrl(index);
const QUrl dest = fileModel()->getUrl(index);
bool doDownload = index.data(Qt::CheckStateRole).toBool();
if (m_dataSourceFactory.contains(dest))
{
......@@ -723,7 +723,7 @@ void Metalink::filesSelected()
if (result == KIO::R_RENAME) {
//no reason to use FileModel::rename() since the file does not exist yet, so simply skip it
//avoids having to deal with signals
const KUrl newDest = dlg.newDestUrl();
const QUrl newDest = dlg.newDestUrl();
factory->setDoDownload(doDownload);
factory->setNewDestination(newDest);
fileModel()->setData(index, newDest.fileName(), FileItem::File);
......@@ -772,7 +772,7 @@ void Metalink::filesSelected()
slotDataSourceFactoryChange(change);
}
void Metalink::slotRename(const KUrl &oldUrl, const KUrl &newUrl)
void Metalink::slotRename(const QUrl &oldUrl, const QUrl &newUrl)
{
if (!m_dataSourceFactory.contains(oldUrl))
{
......@@ -786,7 +786,7 @@ void Metalink::slotRename(const KUrl &oldUrl, const KUrl &newUrl)
setTransferChange(Tc_FileName);
}
bool Metalink::setDirectory(const KUrl &new_directory)
bool Metalink::setDirectory(const QUrl &new_directory)
{
if (new_directory == directory())
{
......@@ -798,17 +798,17 @@ bool Metalink::setDirectory(const KUrl &new_directory)
m_fileModel->setDirectory(new_directory);
}
const QString oldDirectory = directory().pathOrUrl(KUrl::AddTrailingSlash);
const QString newDirectory = new_directory.pathOrUrl(KUrl::AddTrailingSlash);
const QString oldDirectory = directory().pathOrUrl(QUrl::AddTrailingSlash);
const QString newDirectory = new_directory.pathOrUrl(QUrl::AddTrailingSlash);
const QString fileName = m_dest.fileName();
m_dest = new_directory;
m_dest.addPath(fileName);
QHash<KUrl, DataSourceFactory*> newStorage;
QHash<QUrl, DataSourceFactory*> newStorage;
foreach (DataSourceFactory *factory, m_dataSourceFactory)
{
const KUrl oldUrl = factory->dest();
const KUrl newUrl = KUrl(oldUrl.pathOrUrl().replace(oldDirectory, newDirectory));
const QUrl oldUrl = factory->dest();
const QUrl newUrl = QUrl(oldUrl.pathOrUrl().replace(oldDirectory, newDirectory));
factory->setNewDestination(newUrl);
newStorage[newUrl] = factory;
}
......@@ -818,9 +818,9 @@ bool Metalink::setDirectory(const KUrl &new_directory)
return true;
}
QHash<KUrl, QPair<bool, int> > Metalink::availableMirrors(const KUrl &file) const
QHash<QUrl, QPair<bool, int> > Metalink::availableMirrors(const QUrl &file) const
{
QHash<KUrl, QPair<bool, int> > urls;
QHash<QUrl, QPair<bool, int> > urls;
if (m_dataSourceFactory.contains(file))
{
......@@ -831,7 +831,7 @@ QHash<KUrl, QPair<bool, int> > Metalink::availableMirrors(const KUrl &file) cons
}
void Metalink::setAvailableMirrors(const KUrl &file, const QHash<KUrl, QPair<bool, int> > &mirrors)
void Metalink::setAvailableMirrors(const QUrl &file, const QHash<QUrl, QPair<bool, int> > &mirrors)
{
if (!m_dataSourceFactory.contains(file))
{
......
......@@ -26,7 +26,7 @@ class Metalink : public Transfer
public:
Metalink(TransferGroup * parent, TransferFactory * factory,
Scheduler * scheduler, const KUrl & src, const KUrl & dest,
Scheduler * scheduler, const QUrl & src, const QUrl & dest,
const QDomElement * e = 0);
~Metalink();
......@@ -39,31 +39,31 @@ class Metalink : public Transfer
*/
int remainingTime() const;
bool repair(const KUrl &file = KUrl());
bool repair(const QUrl &file = QUrl());
/**
* Move the download to the new destination
* @param newDirectory is a directory where the download should be stored
* @returns true if newDestination can be used
*/
virtual bool setDirectory(const KUrl &newDirectory);
virtual bool setDirectory(const QUrl &newDirectory);
QHash<KUrl, QPair<bool, int> > availableMirrors(const KUrl &file) const;
void setAvailableMirrors(const KUrl &file, const QHash<KUrl, QPair<bool, int> > &mirrors);
QHash<QUrl, QPair<bool, int> > availableMirrors(const QUrl &file) const;
void setAvailableMirrors(const QUrl &file, const QHash<QUrl, QPair<bool, int> > &mirrors);
/**
* @param file for which to get the verifier
* @return Verifier that allows you to add checksums manually verify a file etc.
*/
virtual Verifier *verifier(const KUrl &file);
virtual Verifier *verifier(const QUrl &file);
/**
* @param file for which to get the signature
* @return Signature that allows you to add signatures and verify them
*/
virtual Signature *signature(const KUrl &file);
virtual Signature *signature(const QUrl &file);
virtual QList<KUrl> files() const;
virtual QList<QUrl> files() const;
FileModel *fileModel();
......@@ -80,7 +80,7 @@ class Metalink : public Transfer
* @note false does not mean that an error happened, it could mean, that the user
* decided to update the metalink
*/
bool metalinkInit(const KUrl &url = KUrl(), const QByteArray &data = QByteArray());
bool metalinkInit(const QUrl &url = QUrl(), const QByteArray &data = QByteArray());
void fileDlgFinished(int result);
/**
......@@ -91,7 +91,7 @@ class Metalink : public Transfer
void filesSelected();
void slotUpdateCapabilities();
void slotDataSourceFactoryChange(Transfer::ChangesFlags change);
void slotRename(const KUrl &oldUrl, const KUrl &newUrl);
void slotRename(const QUrl &oldUrl, const QUrl &newUrl);
void slotVerified(bool isVerified);
void slotSignatureVerified();
......@@ -108,9 +108,9 @@ class Metalink : public Transfer
FileModel *m_fileModel;
int m_currentFiles;
bool m_metalinkJustDownloaded;
KUrl m_localMetalinkLocation;
QUrl m_localMetalinkLocation;
KGetMetalink::Metalink m_metalink;
QHash<KUrl, DataSourceFactory*> m_dataSourceFactory;
QHash<QUrl, DataSourceFactory*> m_dataSourceFactory;
bool m_ready;
int m_speedCount;
int m_tempAverageSpeed;
......
......@@ -55,11 +55,11 @@ QString base64ToHex(const QString& b64)
}
MetalinkHttp::MetalinkHttp(TransferGroup * parent, TransferFactory * factory,
Scheduler * scheduler, const KUrl & source, const KUrl & dest,
Scheduler * scheduler, const QUrl & source, const QUrl & dest,
KGetMetalink::MetalinkHttpParser *httpParser,
const QDomElement * e)
: AbstractMetalink(parent,factory,scheduler,source, dest, e) ,
m_signatureUrl(KUrl()),
m_signatureUrl(QUrl()),
m_httpparser(httpParser)
{
......@@ -138,7 +138,7 @@ void MetalinkHttp::start()
}
}
void MetalinkHttp::setSignature(KUrl & dest, QByteArray & data, DataSourceFactory* dataFactory)
void MetalinkHttp::setSignature(QUrl & dest, QByteArray & data, DataSourceFactory* dataFactory)
{
Q_UNUSED(dest);
dataFactory->signature()->setSignature(data,Signature::AsciiDetached);
......@@ -178,9 +178,8 @@ void MetalinkHttp::slotSignatureVerified()
bool MetalinkHttp::metalinkHttpInit()
{
kDebug() << "m_dest = " << m_dest;
const KUrl tempDest = KUrl(m_dest.adjusted(QUrl::RemoveFilename));
KUrl dest = tempDest;
dest.addPath(m_dest.fileName());
const QUrl tempDest = QUrl(m_dest.adjusted(QUrl::RemoveFilename));
QUrl dest = tempDest.toString() + "/" + m_dest.fileName();
kDebug() << "dest = " << dest;
//sort the urls according to their priority (highest first)
......@@ -198,7 +197,7 @@ bool MetalinkHttp::metalinkHttpInit()
//add the Mirrors Sources
for(int i = 0; i < m_linkheaderList.size(); ++i) {
const KUrl url = m_linkheaderList[i].url;
const QUrl url = m_linkheaderList[i].url;
if (url.isValid()) {
if (m_linkheaderList[i].pref) {
kDebug() << "found etag in a mirror" ;
......@@ -226,9 +225,9 @@ bool MetalinkHttp::metalinkHttpInit()
dataFactory->verifier()->addChecksums(m_DigestList);
//Add OpenPGP signatures
if (m_signatureUrl != KUrl()) {
if (m_signatureUrl != QUrl()) {
Download *signat_download = new Download(m_signatureUrl, QString(KStandardDirs::locateLocal("appdata", "metalinks/") + m_source.fileName()));
connect(signat_download, SIGNAL(finishedSuccessfully(KUrl,QByteArray)), SLOT(setSignature(KUrl,QByteArray)));
connect(signat_download, SIGNAL(finishedSuccessfully(QUrl,QByteArray)), SLOT(setSignature(QUrl,QByteArray)));
}
m_dataSourceFactory[dataFactory->dest()] = dataFactory;
}
......
......@@ -28,7 +28,7 @@ class MetalinkHttp : public AbstractMetalink
public:
MetalinkHttp(TransferGroup * parent, TransferFactory * factory,
Scheduler * scheduler, const KUrl & src, const KUrl & dest,
Scheduler * scheduler, const QUrl & src, const QUrl & dest,
KGetMetalink::MetalinkHttpParser *httpParser, const QDomElement * e = 0 );
~MetalinkHttp();
......@@ -53,7 +53,7 @@ class MetalinkHttp : public AbstractMetalink
* @note sets the signatures in the headers to the signature reader
*/
void setSignature(KUrl & dest, QByteArray & data, DataSourceFactory* dataFactory);
void setSignature(QUrl & dest, QByteArray & data, DataSourceFactory* dataFactory);
/**
* @note sets the Instance Digests in the headers to the vlaues as per
......@@ -68,8 +68,8 @@ class MetalinkHttp : public AbstractMetalink
void setLinks();
private:
KUrl m_signatureUrl;
KUrl m_metalinkxmlUrl ;
QUrl m_signatureUrl;
QUrl m_metalinkxmlUrl ;
void startMetalink();
KGetMetalink::MetalinkHttpParser *m_httpparser;
QList<KGetMetalink::HttpLinkHeader> m_linkheaderList;
......
......@@ -85,7 +85,7 @@ void DragDlg::slotFinished()
m_commonData->identity = uiData.identity->text();
m_commonData->version = uiData.version->text();
m_commonData->description = uiData.description->text();
m_commonData->logo = KUrl(uiData.logo->text());
m_commonData->logo = QUrl(uiData.logo->text());
if (uiData.os->text().isEmpty()) {
m_commonData->oses.clear();
} else {
......@@ -93,7 +93,7 @@ void DragDlg::slotFinished()
}
m_commonData->copyright = uiData.copyright->text();
m_commonData->publisher.name = uiData.pub_name->text();
m_commonData->publisher.url = KUrl(uiData.pub_url->text());
m_commonData->publisher.url = QUrl(uiData.pub_url->text());
m_commonData->languages << uiData.language->itemData(uiData.language->currentIndex()).toString();
emit usedTypes(used, ui.partialChecksums->isChecked());
......
......@@ -168,13 +168,13 @@ void FileDlg::slotOkClicked()
m_file->data.identity = uiData.identity->text();
m_file->data.version = uiData.version->text();
m_file->data.description = uiData.description->text();
m_file->data.logo = KUrl(uiData.logo->text());
m_file->data.logo = QUrl(uiData.logo->text());
if (!uiData.os->text().isEmpty()) {
m_file->data.oses = uiData.os->text().split(i18nc("comma, to seperate members of a list", ","));
}
m_file->data.copyright = uiData.copyright->text();
m_file->data.publisher.name = uiData.pub_name->text();
m_file->data.publisher.url = KUrl(uiData.pub_url->text());
m_file->data.publisher.url = QUrl(uiData.pub_url->text());
m_file->data.languages << uiData.language->itemData(uiData.language->currentIndex()).toString();
m_urlWidget->save();
......
......@@ -69,13 +69,13 @@ void FileHandlerThread::run()
while (files.count() && !abort) {
//take the first file and try to handle it
FileData data = files.takeFirst();
const KUrl url = data.url;
const QUrl url = data.url;
KGetMetalink::File file = data.file;
file.data = commonData;
foreach (const KGetMetalink::Url &metalinkUrl, tempResources.urls) {
KGetMetalink::Url mirror = metalinkUrl;
mirror.url.addPath(file.name);
mirror.url.setPath(mirror.url.toString() + "/" + file.name);
//if the url has already been added, remove it and readd it
for (int i = 0; i < file.resources.urls.count(); ++i) {
......@@ -150,7 +150,7 @@ void DirectoryHandler::slotFiles(const QList<QUrl> &files)
m_allJobsStarted = false;
foreach (const KUrl &url, files) {
foreach (const QUrl &url, files) {
QDir dir(url.path());
if (dir.exists()) {
KIO::ListJob *listJob = KIO::listRecursive(url);
......@@ -180,7 +180,7 @@ void DirectoryHandler::slotDirEntries(KIO::Job *j, const KIO::UDSEntryList &entr
return;
}
const KUrl baseUrl = m_jobs[job];
const QUrl baseUrl = m_jobs[job];
const QString baseDir = baseUrl.fileName() + '/';
foreach (const KIO::UDSEntry &entry, entries) {
......
......@@ -87,7 +87,7 @@ void GeneralWidget::load(const KGetMetalink::Metalink &metalink) const
void GeneralWidget::save(KGetMetalink::Metalink *metalink)
{
metalink->origin = KUrl(ui.origin->text());
metalink->origin = QUrl(ui.origin->text());
metalink->dynamic = ui.dynamic->isChecked();
metalink->published.clear();
......
......@@ -29,7 +29,7 @@
#include <QMimeData>
#include <QStandardItemModel>
#include <KFileDialog>
#include <QFileDialog>
#include <KLocalizedString>
#include <KMessageBox>
#include <QPushButton>
......@@ -74,7 +74,7 @@ MetalinkCreator::MetalinkCreator(QWidget *parent)
{
create();
connect(this, SIGNAL(user1Clicked()), this, SLOT(slotSave()));
connect(finishButton(), &QPushButton::clicked, this, &MetalinkCreator::slotSave);
connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)), this, SLOT(slotUpdateAssistantButtons(KPageWidgetItem*,KPageWidgetItem*)));
qRegisterMetaType<KGetMetalink::File>("KGetMetalink::File");
......@@ -139,12 +139,12 @@ void MetalinkCreator::slotDelayedCreation()
void MetalinkCreator::load()
{
KUrl url = KUrl(uiIntroduction.load->text());
QUrl url = uiIntroduction.load->url();
if (uiIntroduction.loadButton->isChecked() && url.isValid())
{
if (!KGetMetalink::HandleMetalink::load(url, &metalink))
{
KMessageBox::error(this, i18n("Unable to load: %1", url.pathOrUrl()), i18n("Error"));
KMessageBox::error(this, i18n("Unable to load: %1", url.toString()), i18n("Error"));
}
}
......@@ -156,12 +156,12 @@ void MetalinkCreator::slotSave()
{
m_general->save(&metalink);
KUrl url = KUrl(uiIntroduction.save->text());
QUrl url = uiIntroduction.save->url();
if (url.isValid())
{
if(!KGetMetalink::HandleMetalink::save(url, &metalink))
{
KMessageBox::error(this, i18n("Unable to save to: %1", url.pathOrUrl()), i18n("Error"));
KMessageBox::error(this, i18n("Unable to save to: %1", url.toString()), i18n("Error"));
}
}
}
......@@ -252,8 +252,8 @@ void MetalinkCreator::slotUpdateFilesButtons()
void MetalinkCreator::slotAddLocalFilesClicked()
{
QPointer<KFileDialog> dialog = new KFileDialog(KUrl(), QString(), this);
dialog->setMode(KFile::Files | KFile::ExistingOnly | KFile::LocalOnly);
QPointer<QFileDialog> dialog = new QFileDialog(this);
dialog->setFileMode(QFileDialog::ExistingFiles);
if (dialog->exec() == QDialog::Accepted) {
m_handler->slotFiles(dialog->selectedUrls());
}
......
......@@ -161,12 +161,12 @@ void KGetMetalink::CommonData::load(const QDomElement &e)
identity = e.firstChildElement("identity").text();
version = e.firstChildElement("version").text();
description = e.firstChildElement("description").text();
logo = KUrl(e.firstChildElement("logo").text());
logo = QUrl(e.firstChildElement("logo").text());
copyright = e.firstChildElement("copyright").text();
const QDomElement publisherElem = e.firstChildElement("publisher");
publisher.name = publisherElem.attribute("name");
publisher.url = KUrl(publisherElem.attribute("url"));
publisher.url = QUrl(publisherElem.attribute("url"));
for (QDomElement elemRes = e.firstChildElement("language"); !elemRes.isNull(); elemRes = elemRes.nextSiblingElement("language")) {
languages << elemRes.text();
......@@ -317,7 +317,7 @@ void KGetMetalink::Metaurl::load(const QDomElement &e)
priority = Metalink::MAX_URL_PRIORITY;
}
name = e.attribute("name");
url = KUrl(e.text());
url = QUrl(e.text());
}
void KGetMetalink::Metaurl::save(QDomElement &e) const
......@@ -342,7 +342,7 @@ void KGetMetalink::Metaurl::save(QDomElement &e) const
bool KGetMetalink::Metaurl::isValid()
{
return url.isValid() && url.hasHost() && !url.protocol().isEmpty() && !type.isEmpty();
return url.isValid() && !url.host().isEmpty() && !url.scheme().isEmpty() && !type.isEmpty();
}
void KGetMetalink::Metaurl::clear()
......@@ -373,7 +373,7 @@ void KGetMetalink::Url::load(const QDomElement &e)
if (priority > Metalink::MAX_URL_PRIORITY) {
priority = Metalink::MAX_URL_PRIORITY;
}
url = KUrl(e.text());
url = QUrl(e.text());
}
void KGetMetalink::Url::save(QDomElement &e) const
......@@ -397,7 +397,7 @@ void KGetMetalink::Url::save(QDomElement &e) const
bool KGetMetalink::Url::isValid()
{
return url.isValid() && url.hasHost() && !url.protocol().isEmpty();
return url.isValid() && !url.host().isEmpty() && !url.scheme().isEmpty();
}
void KGetMetalink::Url::clear()
......@@ -710,7 +710,7 @@ void KGetMetalink::Metalink::load(const QDomElement &e)
published.setData(metalink.firstChildElement("published").text());
updated.setData(metalink.firstChildElement("updated").text());
const QDomElement originElem = metalink.firstChildElement("origin");
origin = KUrl(metalink.firstChildElement("origin").text());
origin = QUrl(metalink.firstChildElement("origin").text());
if (originElem.hasAttribute("dynamic")) {
bool worked = false;
dynamic = originElem.attribute("dynamic").toInt(&worked);
......@@ -796,7 +796,7 @@ void KGetMetalink::Metalink_v3::load(const QDomElement &e)
const QDomElement metalinkDom = doc.firstChildElement("metalink");
m_metalink.dynamic = (metalinkDom.attribute("type") == "dynamic");
m_metalink.origin = KUrl(metalinkDom.attribute("origin"));
m_metalink.origin = QUrl(metalinkDom.attribute("origin"));
m_metalink.generator = metalinkDom.attribute("generator");
m_metalink.published = parseDateConstruct(metalinkDom.attribute("pubdate"));
m_metalink.updated = parseDateConstruct(metalinkDom.attribute("refreshdate"));
......@@ -863,7 +863,7 @@ KGetMetalink::CommonData KGetMetalink::Metalink_v3::parseCommonData(const QDomEl
const QDomElement publisherElem = e.firstChildElement("publisher");
data.publisher.name = publisherElem.firstChildElement("name").text();
data.publisher.url = KUrl(publisherElem.firstChildElement("url").text());
data.publisher.url = QUrl(publisherElem.firstChildElement("url").text());
return data;
}
......@@ -916,7 +916,7 @@ KGetMetalink::Resources KGetMetalink::Metalink_v3::parseResources(const QDomElem
}
const int priority = MAX_PREFERENCE - preference + 1;//convert old preference to new priority
const KUrl link = KUrl(elemRes.text());
const QUrl link = QUrl(elemRes.text());
QString type;
if (link.fileName().endsWith(QLatin1String(".torrent"))) {
......@@ -1232,9 +1232,9 @@ QString KGetMetalink::Metalink_v3::dateConstructToString(const KGetMetalink::Dat
}
bool KGetMetalink::HandleMetalink::load(const KUrl &destination, KGetMetalink::Metalink *metalink)
bool KGetMetalink::HandleMetalink::load(const QUrl &destination, KGetMetalink::Metalink *metalink)
{
QFile file(destination.pathOrUrl());
QFile file(destination.toString());
if (!file.open(QIODevice::ReadOnly))
{
return false;
......@@ -1296,9 +1296,9 @@ bool KGetMetalink::HandleMetalink::load(const QByteArray &data, KGetMetalink::Me
return false;
}
bool KGetMetalink::HandleMetalink::save(const KUrl &destination, KGetMetalink::Metalink *metalink)
bool KGetMetalink::HandleMetalink::save(const QUrl &destination, KGetMetalink::Metalink *metalink)
{
QFile file(destination.pathOrUrl());
QFile file(destination.toString());
if (!file.open(QIODevice::WriteOnly)) {
return false;
}
......@@ -1362,7 +1362,7 @@ void KGetMetalink::MetalinkHttpParser::checkMetalinkHttp()
job->addMetaData("PropagateHttpHeader", "true");
job->setRedirectionHandlingEnabled(false);
connect(job, SIGNAL(result(KJob*)), this, SLOT(slotHeaderResult(KJob*))); // Finished
connect(job, SIGNAL(redirection(KIO::Job*,KUrl)), this, SLOT(slotRedirection(KIO::Job*,KUrl))); // Redirection
connect(job, SIGNAL(redirection(KIO::Job*,QUrl)), this, SLOT(slotRedirection(KIO::Job*,QUrl))); // Redirection
connect(job,SIGNAL(mimetype(KIO::Job*,QString)),this,SLOT(detectMime(KIO::Job*,QString))); // Mime detection.
kDebug() << " Verifying Metalink/HTTP Status" ;
m_loop.exec();
......@@ -1385,7 +1385,7 @@ void KGetMetalink::MetalinkHttpParser::slotHeaderResult(KJob* kjob)
// Handle the redirection... (Comment out if not desired)
if (m_redirectionUrl.isValid()) {
m_Url = m_redirectionUrl;
m_redirectionUrl = KUrl();
m_redirectionUrl = QUrl();
checkMetalinkHttp();
}
......@@ -1393,7 +1393,7 @@ void KGetMetalink::MetalinkHttpParser::slotHeaderResult(KJob* kjob)
m_loop.exit();
}
void KGetMetalink::MetalinkHttpParser::slotRedirection(KIO::Job *job, const KUrl & url)
void KGetMetalink::MetalinkHttpParser::slotRedirection(KIO::Job *job, const QUrl & url)
{
Q_UNUSED(job)
m_redirectionUrl = url;
......@@ -1456,7 +1456,7 @@ void KGetMetalink::MetalinkHttpParser::setMetalinkHSatus()
}
KUrl KGetMetalink::MetalinkHttpParser::getUrl()
QUrl KGetMetalink::MetalinkHttpParser::getUrl()
{
return m_Url;
}
......
......@@ -23,7 +23,7 @@
#define Metalinker_H
#include <KIO/Job>
#include <KUrl>
#include <QUrl>
#include <QDate>
#include <QDomElement>
#include <QEventLoop>
......@@ -83,7 +83,7 @@ class UrlText
void clear();
QString name;
KUrl url;
QUrl url;
};
/**
......@@ -111,7 +111,7 @@ class CommonData
QString version;
QString description;
QStringList oses;
KUrl logo;
QUrl logo;
QStringList languages;
UrlText publisher;
QString copyright;
......@@ -150,7 +150,7 @@ class Metaurl
*/
QString name;
KUrl url;
QUrl url;
};