Commit 153d23a8 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port away from deprecated KIO::stat()

parent 153f2a9d
......@@ -22,7 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QImage>
#include <QPainter>
// KDE
// KF
#include <kio_version.h>
#include <KJobUiDelegate>
#include <KIO/StatJob>
#include <QTest>
......@@ -267,7 +268,11 @@ void DocumentTest::testLoadRemote()
url = url.adjusted(QUrl::StripTrailingSlash);
url.setPath(url.path() + '/' + "test.png");
#if KIO_VERSION >= QT_VERSION_CHECK(5, 69, 0)
QVERIFY2(KIO::statDetails(url, KIO::StatJob::SourceSide, KIO::StatNoDetails)->exec(), "test url not found");
#else
QVERIFY2(KIO::stat(url, KIO::StatJob::SourceSide, 0)->exec(), "test url not found");
#endif
Document::Ptr doc = DocumentFactory::instance()->load(url);
doc->waitUntilLoaded();
......
......@@ -21,14 +21,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// Qt
#include <QTimer>
#include <QStandardPaths>
// KDE
// KF
#include <kio_version.h>
#include <KIO/StatJob>
#include <KIO/DeleteJob>
#include <KIO/MkdirJob>
#include <KIO/FileCopyJob>
#include <KJobWidgets>
#include <QStandardPaths>
QUrl setUpRemoteTestDir(const QString& testFile)
{
......@@ -42,7 +43,11 @@ QUrl setUpRemoteTestDir(const QString& testFile)
baseUrl = baseUrl.adjusted(QUrl::StripTrailingSlash);
baseUrl.setPath(baseUrl.path() + "/gwenview-remote-tests");
#if KIO_VERSION >= QT_VERSION_CHECK(5, 69, 0)
auto* statJob = KIO::statDetails(baseUrl, KIO::StatJob::DestinationSide, KIO::StatNoDetails);
#else
KIO::StatJob *statJob = KIO::stat(baseUrl, KIO::StatJob::DestinationSide, 0);
#endif
KJobWidgets::setWindow(statJob, authWindow);
if (statJob->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