Commit af59baf6 authored by David Faure's avatar David Faure
Browse files

Port urlExists() from NetAccess to KIO::NetAccess::exists

Reviewers: broulik, andreagenor, tcanabrava, vkrause

Reviewed By: vkrause

Subscribers: vkrause

Maniphest Tasks: T11576

Differential Revision: https://phabricator.kde.org/D25478
parent 2147b5c1
...@@ -48,8 +48,9 @@ ...@@ -48,8 +48,9 @@
#include "kpLogCategories.h" #include "kpLogCategories.h"
#include <kio/netaccess.h> // kdelibs4support #include <KJobWidgets>
#include <KLocalizedString> #include <KLocalizedString>
#include <KIO/StatJob>
#include <QColor> #include <QColor>
#include <QBitmap> #include <QBitmap>
...@@ -155,9 +156,12 @@ bool kpDocument::isFromExistingURL () const ...@@ -155,9 +156,12 @@ bool kpDocument::isFromExistingURL () const
// public // public
bool kpDocument::urlExists (const QUrl &url) const bool kpDocument::urlExists (const QUrl &url) const
{ {
return (!url.isEmpty () && if (url.isEmpty()) {
KIO::NetAccess::exists (url, KIO::NetAccess::SourceSide/*open*/, return false;
d->environ->dialogParent ())); }
KIO::StatJob *job = KIO::stat (url, KIO::StatJob::SourceSide, 0);
KJobWidgets::setWindow (job, d->environ->dialogParent ());
return job->exec();
} }
//--------------------------------------------------------------------- //---------------------------------------------------------------------
......
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