diff --git a/core/linkimporter.cpp b/core/linkimporter.cpp --- a/core/linkimporter.cpp +++ b/core/linkimporter.cpp @@ -22,7 +22,6 @@ #include #include #include -#include //static QString REGULAR_EXPRESSION = "(((https?|ftp|gopher)://|(mailto|file|news):)[^’ <>\"]+|(www|web|w3).[-a-z0-9.]+)[^’ .,;<>\":]"; // static QString REGULAR_EXPRESSION = "((http|https|ftp|ftps)+([\\:\\w\\d:#@%/;$()~_?\\+-=\\\\.&])*)"; @@ -80,9 +79,7 @@ QUrl aux(m_tempFile); KIO::CopyJob *job = KIO::copy(m_url, aux, KIO::HideProgressInfo); - QMap metaData; - bool ok = KIO::NetAccess::synchronousRun(job, nullptr, nullptr, nullptr, &metaData); - if(!ok) { + if(!job->exec()) { emit error(ki18n("Error trying to get %1").subs(m_url.url())); } } diff --git a/core/mostlocalurl.cpp b/core/mostlocalurl.cpp --- a/core/mostlocalurl.cpp +++ b/core/mostlocalurl.cpp @@ -22,8 +22,8 @@ #include "plugin/transferfactory.h" #include "kget_debug.h" -#include -#include +#include +#include QUrl mostLocalUrl(const QUrl &url) { @@ -35,8 +35,12 @@ } } - qCDebug(KGET_DEBUG) << "Starting KIO::NetAccess::mostLocalUrl for:" << url; - return KIO::NetAccess::mostLocalUrl(url, nullptr); + qCDebug(KGET_DEBUG) << "Trying to find the most local URL for:" << url; + KIO::StatJob* job = KIO::mostLocalUrl(url, KIO::HideProgressInfo); + if (job->exec()) { + return job->mostLocalUrl(); + }; + return url; } MostLocalUrlJob *mostLocalUrlJob(const QUrl &url) diff --git a/core/transfergroup.h b/core/transfergroup.h --- a/core/transfergroup.h +++ b/core/transfergroup.h @@ -15,7 +15,6 @@ #include #include -#include #include #include "jobqueue.h" diff --git a/transfer-plugins/checksumsearch/checksumsearchtransferdatasource.cpp b/transfer-plugins/checksumsearch/checksumsearchtransferdatasource.cpp --- a/transfer-plugins/checksumsearch/checksumsearchtransferdatasource.cpp +++ b/transfer-plugins/checksumsearch/checksumsearchtransferdatasource.cpp @@ -25,7 +25,6 @@ #include #include -#include #include @@ -63,7 +62,9 @@ const QUrl dest = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/checksumsearch/") + QString::number(files++)); if (QFile::exists(dest.toLocalFile())) { KIO::Job *del = KIO::del(dest, KIO::HideProgressInfo); - KIO::NetAccess::synchronousRun(del, nullptr); + if (!del->exec()) { + qCDebug(KGET_DEBUG) << "Could not delete " << dest.path(); + } } if (baseUrl.scheme() != "ftp" && baseUrl.scheme() != "sftp") { diff --git a/transfer-plugins/kio/transferKio.cpp b/transfer-plugins/kio/transferKio.cpp --- a/transfer-plugins/kio/transferKio.cpp +++ b/transfer-plugins/kio/transferKio.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -125,7 +124,9 @@ if (options & DeleteFiles)//if the transfer is not finished, we delete the *.part-file { KIO::Job *del = KIO::del(QString(m_dest.path() + ".part"), KIO::HideProgressInfo); - KIO::NetAccess::synchronousRun(del, nullptr); + if (!del->exec()) { + qCDebug(KGET_DEBUG) << "Could not delete part " << QString(m_dest.path() + ".part"); + } }//TODO: Ask the user if he/she wants to delete the *.part-file? To discuss (boom1992) } diff --git a/transfer-plugins/metalink/abstractmetalink.cpp b/transfer-plugins/metalink/abstractmetalink.cpp --- a/transfer-plugins/metalink/abstractmetalink.cpp +++ b/transfer-plugins/metalink/abstractmetalink.cpp @@ -25,7 +25,6 @@ #include "kget_debug.h" #include #include -#include #include #include #include diff --git a/transfer-plugins/metalink/metalink.cpp b/transfer-plugins/metalink/metalink.cpp --- a/transfer-plugins/metalink/metalink.cpp +++ b/transfer-plugins/metalink/metalink.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -290,7 +289,9 @@ if ((options & Transfer::DeleteTemporaryFiles) && m_localMetalinkLocation.isLocalFile()) { KIO::Job *del = KIO::del(m_localMetalinkLocation, KIO::HideProgressInfo); - KIO::NetAccess::synchronousRun(del, nullptr); + if (!del->exec()) { + qCDebug(KGET_DEBUG) << "Could not delete " << m_localMetalinkLocation.path(); + } } } diff --git a/transfer-plugins/metalink/metalinkhttp.cpp b/transfer-plugins/metalink/metalinkhttp.cpp --- a/transfer-plugins/metalink/metalinkhttp.cpp +++ b/transfer-plugins/metalink/metalinkhttp.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include diff --git a/transfer-plugins/metalink/metalinkxml.cpp b/transfer-plugins/metalink/metalinkxml.cpp --- a/transfer-plugins/metalink/metalinkxml.cpp +++ b/transfer-plugins/metalink/metalinkxml.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -259,7 +258,9 @@ if ((options & Transfer::DeleteTemporaryFiles) && m_localMetalinkLocation.isLocalFile()) { KIO::Job *del = KIO::del(m_localMetalinkLocation, KIO::HideProgressInfo); - KIO::NetAccess::synchronousRun(del, nullptr); + if (!del->exec()) { + qCDebug(KGET_DEBUG) << "Could not delete " << m_localMetalinkLocation.path(); + } } } diff --git a/transfer-plugins/mmsthreads/mmstransfer.cpp b/transfer-plugins/mmsthreads/mmstransfer.cpp --- a/transfer-plugins/mmsthreads/mmstransfer.cpp +++ b/transfer-plugins/mmsthreads/mmstransfer.cpp @@ -103,9 +103,13 @@ /** Deleting the temporary file and the unfinish file*/ if (options & Transfer::DeleteFiles) { KIO::Job *del = KIO::del(QUrl::fromLocalFile(m_fileTemp), KIO::HideProgressInfo); - KIO::NetAccess::synchronousRun(del, nullptr); + if (!del->exec()) { + qCDebug(KGET_DEBUG) << "Could not delete " << m_fileTemp; + } del = KIO::del(m_dest, KIO::HideProgressInfo); - KIO::NetAccess::synchronousRun(del, nullptr); + if (!del->exec()) { + qCDebug(KGET_DEBUG) << "Could not delete " << m_dest.path(); + } } } @@ -126,7 +130,9 @@ m_downloadSpeed = 0; setTransferChange(Tc_Status | Tc_Percent | Tc_DownloadSpeed, true); KIO::Job *del = KIO::del(QUrl::fromLocalFile(m_fileTemp), KIO::HideProgressInfo); - KIO::NetAccess::synchronousRun(del, nullptr); + if (!del->exec()) { + qCDebug(KGET_DEBUG) << "Could not delete " << m_fileTemp; + } } /** If m_retryDownload == true then some threads has fail to connect, so the download was @@ -137,7 +143,9 @@ if (m_retryDownload) { m_retryDownload = false; KIO::Job *del = KIO::del(QUrl::fromLocalFile(m_fileTemp), KIO::HideProgressInfo); - KIO::NetAccess::synchronousRun(del, nullptr); + if (!del->exec()) { + qCDebug(KGET_DEBUG) << "Could not delete " << m_fileTemp; + } start(); } } diff --git a/transfer-plugins/multisegmentkio/transfermultisegkio.cpp b/transfer-plugins/multisegmentkio/transfermultisegkio.cpp --- a/transfer-plugins/multisegmentkio/transfermultisegkio.cpp +++ b/transfer-plugins/multisegmentkio/transfermultisegkio.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include diff --git a/ui/history/transferhistoryitemdelegate.cpp b/ui/history/transferhistoryitemdelegate.cpp --- a/ui/history/transferhistoryitemdelegate.cpp +++ b/ui/history/transferhistoryitemdelegate.cpp @@ -24,7 +24,6 @@ #include #include -#include #include #include #include