k3b/fix-build-with-older-kio.patch
Luca Beltrame 6f6813e531 Accepting request 562852 from home:wolfi323:branches:KDE:Applications
- Add fix-build-with-older-kio.patch to make it build again on
  standard Leap 42.x.

(mainly for Packman)

OBS-URL: https://build.opensuse.org/request/show/562852
OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/k3b?expand=0&rev=57
2018-01-09 11:42:56 +00:00

43 lines
1.4 KiB
Diff

From 1f36ad0aad6bce75318268acf36374d13d479a66 Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
Date: Tue, 9 Jan 2018 10:54:06 +0100
Subject: [PATCH] Fix build with KIO < 5.33
KUrlRequester::setAcceptMode() got introduced in KIO 5.33.0, but k3b
specifies 5.21.0 as minimum version.
Modify the KUrlRequester's fileDialog() directly when using an older
version to fix the compilation.
Differential Revision: https://phabricator.kde.org/D9718
---
src/k3btempdirselectionwidget.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/k3btempdirselectionwidget.cpp b/src/k3btempdirselectionwidget.cpp
index 3ff3a87b4..395328eb0 100644
--- a/src/k3btempdirselectionwidget.cpp
+++ b/src/k3btempdirselectionwidget.cpp
@@ -26,6 +26,7 @@
#include <KIOCore/KDiskFreeSpaceInfo>
#include <KIOCore/KIO/Global>
#include <KIOWidgets/KUrlRequester>
+#include <kio_version.h>
#include <QtCore/QFileInfo>
#include <QtCore/QTimer>
@@ -68,7 +69,11 @@ K3b::TempDirSelectionWidget::TempDirSelectionWidget( QWidget *parent )
// choose a default
setSelectionMode( DIR );
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 33, 0)
m_editDirectory->setAcceptMode(QFileDialog::AcceptSave);
+#else
+ m_editDirectory->fileDialog()->setAcceptMode(QFileDialog::AcceptSave);
+#endif
m_editDirectory->setUrl( QUrl::fromLocalFile( k3bcore->globalSettings()->defaultTempPath() ) );
slotUpdateFreeTempSpace();
--
2.13.6