[SCM] kdelibs4support packaging branch, master, updated. debian/5.28.0-1-9-g9554bd2
Maximiliano Curia
maxy at moszumanska.debian.org
Sat Apr 1 16:37:08 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/frameworks/kdelibs4support.git;a=commitdiff;h=fd242e2
The following commit has been merged in the master branch:
commit fd242e244a35e6103e92d6a16c59c18aaf2b2350
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date: Sat Apr 1 18:12:49 2017 +0200
Add new upstream patch: Fix-bug-in-kfiledialog.cpp-that-causes-crashing-when-nati.patch
---
...dialog.cpp-that-causes-crashing-when-nati.patch | 264 +++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 265 insertions(+)
diff --git a/debian/patches/Fix-bug-in-kfiledialog.cpp-that-causes-crashing-when-nati.patch b/debian/patches/Fix-bug-in-kfiledialog.cpp-that-causes-crashing-when-nati.patch
new file mode 100644
index 0000000..e872ecf
--- /dev/null
+++ b/debian/patches/Fix-bug-in-kfiledialog.cpp-that-causes-crashing-when-nati.patch
@@ -0,0 +1,264 @@
+From: Jonathan Schultz <jonathan at schultz.la>
+Date: Mon, 27 Feb 2017 00:52:33 +0100
+Subject: Fix bug in kfiledialog.cpp that causes crashing when native widgets
+ are used.
+
+This patch makes kfiledialog functions that did not already do so test the value of d->native before referencing d->w. This is important because if d->native is non-null then d->w will be null and referencing it cause an immediate crash. This was the case on Windows builds of okular when the file chooser was opened.
+
+BUGS: 364086
+Differential Revision: https://phabricator.kde.org/D2075
+---
+ src/kio/kfiledialog.cpp | 122 ++++++++++++++++++++++++++----------------------
+ 1 file changed, 66 insertions(+), 56 deletions(-)
+
+diff --git a/src/kio/kfiledialog.cpp b/src/kio/kfiledialog.cpp
+index d60d5ac8..a5fffbe3 100644
+--- a/src/kio/kfiledialog.cpp
++++ b/src/kio/kfiledialog.cpp
+@@ -300,10 +300,9 @@ KFileDialog::~KFileDialog()
+
+ void KFileDialog::setLocationLabel(const QString &text)
+ {
+- if (d->native) {
+- return; // not available
++ if (d->w) {
++ d->w->setLocationLabel(text);
+ }
+- d->w->setLocationLabel(text);
+ }
+
+ void KFileDialog::setFilter(const QString &filter)
+@@ -317,17 +316,15 @@ void KFileDialog::setFilter(const QString &filter)
+
+ QString KFileDialog::currentFilter() const
+ {
+- if (d->native) {
+- return QString(); // not available
++ if (d->w) {
++ return d->w->currentFilter();
+ }
+- return d->w->currentFilter();
++ return QString(); // not available
+ }
+
+ void KFileDialog::setMimeFilter(const QStringList &mimeTypes,
+ const QString &defaultType)
+ {
+- d->w->setMimeFilter(mimeTypes, defaultType);
+-
+ if (d->native) {
+ QString allExtensions;
+ QStringList filters = mime2KdeFilter(mimeTypes, &allExtensions);
+@@ -335,7 +332,9 @@ void KFileDialog::setMimeFilter(const QStringList &mimeTypes,
+ filters.prepend(allExtensions + QLatin1Char('|') + i18n("All Supported Files"));
+ }
+ d->native->filter = filters.join(QLatin1String("
"));
++ return;
+ }
++ d->w->setMimeFilter(mimeTypes, defaultType);
+ }
+
+ void KFileDialog::clearFilter()
+@@ -368,55 +367,53 @@ QMimeType KFileDialog::currentFilterMimeType()
+
+ void KFileDialog::setPreviewWidget(KPreviewWidgetBase *w)
+ {
+- if (d->native) {
+- return;
++ if (d->w) {
++ d->w->setPreviewWidget(w);
+ }
+- d->w->setPreviewWidget(w);
+ }
+
+ void KFileDialog::setInlinePreviewShown(bool show)
+ {
+- if (d->native) {
+- return;
++ if (d->w) {
++ d->w->setInlinePreviewShown(show);
+ }
+- d->w->setInlinePreviewShown(show);
+ }
+
+ // This is only used for the initial size when no configuration has been saved
+ QSize KFileDialog::sizeHint() const
+ {
+- return d->w->dialogSizeHint();
++ if (d->w) {
++ return d->w->dialogSizeHint();
++ }
++ return QSize();
+ }
+
+ // This slot still exists mostly for compat purposes; for subclasses which reimplement slotOk
+ void KFileDialog::slotOk()
+ {
+- if (d->native) {
+- return;
++ if (d->w) {
++ d->w->slotOk();
+ }
+- d->w->slotOk();
+ }
+
+ // This slot still exists mostly for compat purposes; for subclasses which reimplement accept
+ void KFileDialog::accept()
+ {
+- if (d->native) {
+- return;
++ if (d->w) {
++ setResult(QDialog::Accepted); // keep old behavior; probably not needed though
++ d->w->accept();
++ KConfigGroup cfgGroup(KSharedConfig::openConfig(), ConfigGroup);
++ QDialog::accept();
+ }
+- setResult(QDialog::Accepted); // keep old behavior; probably not needed though
+- d->w->accept();
+- KConfigGroup cfgGroup(KSharedConfig::openConfig(), ConfigGroup);
+- QDialog::accept();
+ }
+
+ // This slot still exists mostly for compat purposes; for subclasses which reimplement slotCancel
+ void KFileDialog::slotCancel()
+ {
+- if (d->native) {
+- return;
++ if (d->w) {
++ d->w->slotCancel();
++ reject();
+ }
+- d->w->slotCancel();
+- reject();
+ }
+
+ void KFileDialog::setUrl(const QUrl &url, bool clearforward)
+@@ -601,7 +598,7 @@ QList<QUrl> KFileDialogPrivate::getOpenUrls(const QUrl &startDir,
+
+ void KFileDialog::setConfirmOverwrite(bool enable)
+ {
+- if (operationMode() == KFileDialog::Saving) {
++ if (d->w && operationMode() == KFileDialog::Saving) {
+ d->w->setConfirmOverwrite(enable);
+ }
+ }
+@@ -869,43 +866,57 @@ KFile::Modes KFileDialog::mode() const
+
+ QPushButton *KFileDialog::okButton() const
+ {
+- return d->w->okButton();
++ if (d->w) {
++ return d->w->okButton();
++ }
++ return nullptr;
+ }
+
+ QPushButton *KFileDialog::cancelButton() const
+ {
+- return d->w->cancelButton();
++ if (d->w) {
++ return d->w->cancelButton();
++ }
++ return nullptr;
+ }
+
+ KUrlComboBox *KFileDialog::locationEdit() const
+ {
+- return d->w->locationEdit();
++ if (d->w) {
++ return d->w->locationEdit();
++ }
++ return nullptr;
+ }
+
+ KFileFilterCombo *KFileDialog::filterWidget() const
+ {
+- return d->w->filterWidget();
++ if (d->w) {
++ return d->w->filterWidget();
++ }
++ return nullptr;
+ }
+
+ KActionCollection *KFileDialog::actionCollection() const
+ {
+- return d->w->actionCollection();
++ if (d->w) {
++ return d->w->actionCollection();
++ }
++ return nullptr;
+ }
+
+ void KFileDialog::setKeepLocation(bool keep)
+ {
+- if (d->native) {
+- return;
++ if (d->w) {
++ d->w->setKeepLocation(keep);
+ }
+- d->w->setKeepLocation(keep);
+ }
+
+ bool KFileDialog::keepsLocation() const
+ {
+- if (d->native) {
+- return false;
++ if (d->w) {
++ return d->w->keepsLocation();
+ }
+- return d->w->keepsLocation();
++ return false;
+ }
+
+ void KFileDialog::setOperationMode(OperationMode mode)
+@@ -927,27 +938,23 @@ KFileDialog::OperationMode KFileDialog::operationMode() const
+
+ void KFileDialog::keyPressEvent(QKeyEvent *e)
+ {
+- if (d->native) {
+- return;
+- }
+-
+- if (e->key() == Qt::Key_Escape) {
+- e->accept();
+- d->w->cancelButton()->animateClick();
+- } else {
+- QDialog::keyPressEvent(e);
++ if (d->w) {
++ if (e->key() == Qt::Key_Escape) {
++ e->accept();
++ d->w->cancelButton()->animateClick();
++ } else {
++ QDialog::keyPressEvent(e);
++ }
+ }
+ }
+
+ void KFileDialog::hideEvent(QHideEvent *e)
+ {
+- if (d->native) {
+- return;
+- }
+-
+- KWindowConfig::saveWindowSize(windowHandle(), d->cfgGroup, KConfigBase::Persistent);
++ if (d->w) {
++ KWindowConfig::saveWindowSize(windowHandle(), d->cfgGroup, KConfigBase::Persistent);
+
+- QDialog::hideEvent(e);
++ QDialog::hideEvent(e);
++ }
+ }
+
+ // static
+@@ -967,7 +974,10 @@ void KFileDialog::setStartDir(const QUrl &directory)
+
+ KToolBar *KFileDialog::toolBar() const
+ {
+- return d->w->toolBar();
++ if (d->w) {
++ return d->w->toolBar();
++ }
++ return nullptr;
+ }
+
+ KFileWidget *KFileDialog::fileWidget()
diff --git a/debian/patches/series b/debian/patches/series
index ab1aa54..8502033 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
incomplete_header
standarddirs_test
+Fix-bug-in-kfiledialog.cpp-that-causes-crashing-when-nati.patch
--
kdelibs4support packaging
More information about the pkg-kde-commits
mailing list