forked from pool/libqt5-qtbase
e4c21e8f38
- Added 0001-QFileDialog-emit-urlsSelected-urlSelected-in-accept.patch, 0002-QUrl-fromLocalFile-QString-should-lead-to-an-empty-U.patch, 0003-QFileDialog-turn-workingDirectory-into-a-QUrl.patch and 0004-QFileDialog-implement-getOpenFileUrl-and-friends-for.patch from upstream to improve QFileDialog behaviour with both local and remote URL's - Added 0001-QKdeTheme-use-system-wide-kdeglobals-as-a-fallback.patch: QTBUG-36184 - Added 0001-Add-QFont-strategy-to-disable-subpixel-antialiasing.patch, 0002-Move-SubpixelAntialiasingType-from-QFontEngineFT-to-.patch, 0003-Support-autohint-and-lcdfilter-fontconfig-configurat.patch and 0004-GTK2-theme-should-use-GTK-configured-font-variant.patch QTBUG-40396, QTBUG-32254, QTBUG-39643 OBS-URL: https://build.opensuse.org/request/show/255354 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=30
108 lines
4.8 KiB
Diff
108 lines
4.8 KiB
Diff
From 9879e5b90b1babcf38236d2c46c187eacf613711 Mon Sep 17 00:00:00 2001
|
|
From: David Faure <david.faure@kdab.com>
|
|
Date: Wed, 9 Jul 2014 11:24:16 +0200
|
|
Subject: [PATCH 1/4] QFileDialog: emit urlsSelected+urlSelected in accept().
|
|
|
|
Not just filesSelected+fileSelected (which only happens for local files).
|
|
|
|
Change-Id: Ife592c3c921231356f96cbc2871b6d724a15d2c8
|
|
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
|
|
(cherry picked from commit da088c5ace607904ec817033d2d48c689ff4816a)
|
|
---
|
|
src/widgets/dialogs/qfiledialog.cpp | 21 +++++++++++++--------
|
|
src/widgets/dialogs/qfiledialog.h | 4 ++--
|
|
src/widgets/dialogs/qfiledialog_p.h | 4 ++--
|
|
3 files changed, 17 insertions(+), 12 deletions(-)
|
|
|
|
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
|
|
index 9219757..037964b 100644
|
|
--- a/src/widgets/dialogs/qfiledialog.cpp
|
|
+++ b/src/widgets/dialogs/qfiledialog.cpp
|
|
@@ -577,8 +577,8 @@ QFileDialogPrivate::~QFileDialogPrivate()
|
|
void QFileDialogPrivate::initHelper(QPlatformDialogHelper *h)
|
|
{
|
|
QFileDialog *d = q_func();
|
|
- QObject::connect(h, SIGNAL(fileSelected(QUrl)), d, SLOT(_q_nativeFileSelected(QUrl)));
|
|
- QObject::connect(h, SIGNAL(filesSelected(QList<QUrl>)), d, SLOT(_q_nativeFilesSelected(QList<QUrl>)));
|
|
+ QObject::connect(h, SIGNAL(fileSelected(QUrl)), d, SLOT(_q_emitUrlSelected(QUrl)));
|
|
+ QObject::connect(h, SIGNAL(filesSelected(QList<QUrl>)), d, SLOT(_q_emitUrlsSelected(QList<QUrl>)));
|
|
QObject::connect(h, SIGNAL(currentChanged(QUrl)), d, SLOT(_q_nativeCurrentChanged(QUrl)));
|
|
QObject::connect(h, SIGNAL(directoryEntered(QUrl)), d, SLOT(_q_nativeEnterDirectory(QUrl)));
|
|
QObject::connect(h, SIGNAL(filterSelected(QString)), d, SIGNAL(filterSelected(QString)));
|
|
@@ -2607,15 +2607,20 @@ void QFileDialog::done(int result)
|
|
void QFileDialog::accept()
|
|
{
|
|
Q_D(QFileDialog);
|
|
- QStringList files = selectedFiles();
|
|
- if (files.isEmpty())
|
|
- return;
|
|
if (!d->usingWidgets()) {
|
|
- d->emitFilesSelected(files);
|
|
+ const QList<QUrl> urls = selectedUrls();
|
|
+ if (urls.isEmpty())
|
|
+ return;
|
|
+ d->_q_emitUrlsSelected(urls);
|
|
+ if (urls.count() == 1)
|
|
+ d->_q_emitUrlSelected(urls.first());
|
|
QDialog::accept();
|
|
return;
|
|
}
|
|
|
|
+ QStringList files = selectedFiles();
|
|
+ if (files.isEmpty())
|
|
+ return;
|
|
QString lineEditText = d->lineEdit()->text();
|
|
// "hidden feature" type .. and then enter, and it will move up a dir
|
|
// special case for ".."
|
|
@@ -3646,7 +3651,7 @@ void QFileDialogPrivate::_q_fileRenamed(const QString &path, const QString oldNa
|
|
}
|
|
}
|
|
|
|
-void QFileDialogPrivate::_q_nativeFileSelected(const QUrl &file)
|
|
+void QFileDialogPrivate::_q_emitUrlSelected(const QUrl &file)
|
|
{
|
|
Q_Q(QFileDialog);
|
|
emit q->urlSelected(file);
|
|
@@ -3654,7 +3659,7 @@ void QFileDialogPrivate::_q_nativeFileSelected(const QUrl &file)
|
|
emit q->fileSelected(file.toLocalFile());
|
|
}
|
|
|
|
-void QFileDialogPrivate::_q_nativeFilesSelected(const QList<QUrl> &files)
|
|
+void QFileDialogPrivate::_q_emitUrlsSelected(const QList<QUrl> &files)
|
|
{
|
|
Q_Q(QFileDialog);
|
|
emit q->urlsSelected(files);
|
|
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
|
|
index 404e16c..184e072 100644
|
|
--- a/src/widgets/dialogs/qfiledialog.h
|
|
+++ b/src/widgets/dialogs/qfiledialog.h
|
|
@@ -287,8 +287,8 @@ private:
|
|
Q_PRIVATE_SLOT(d_func(), void _q_updateOkButton())
|
|
Q_PRIVATE_SLOT(d_func(), void _q_currentChanged(const QModelIndex &index))
|
|
Q_PRIVATE_SLOT(d_func(), void _q_enterDirectory(const QModelIndex &index))
|
|
- Q_PRIVATE_SLOT(d_func(), void _q_nativeFileSelected(const QUrl &))
|
|
- Q_PRIVATE_SLOT(d_func(), void _q_nativeFilesSelected(const QList<QUrl> &))
|
|
+ Q_PRIVATE_SLOT(d_func(), void _q_emitUrlSelected(const QUrl &))
|
|
+ Q_PRIVATE_SLOT(d_func(), void _q_emitUrlsSelected(const QList<QUrl> &))
|
|
Q_PRIVATE_SLOT(d_func(), void _q_nativeCurrentChanged(const QUrl &))
|
|
Q_PRIVATE_SLOT(d_func(), void _q_nativeEnterDirectory(const QUrl&))
|
|
Q_PRIVATE_SLOT(d_func(), void _q_goToDirectory(const QString &path))
|
|
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
|
|
index 632bbca..9e1c23b 100644
|
|
--- a/src/widgets/dialogs/qfiledialog_p.h
|
|
+++ b/src/widgets/dialogs/qfiledialog_p.h
|
|
@@ -210,8 +210,8 @@ public:
|
|
void _q_updateOkButton();
|
|
void _q_currentChanged(const QModelIndex &index);
|
|
void _q_enterDirectory(const QModelIndex &index);
|
|
- void _q_nativeFileSelected(const QUrl &file);
|
|
- void _q_nativeFilesSelected(const QList<QUrl> &files);
|
|
+ void _q_emitUrlSelected(const QUrl &file);
|
|
+ void _q_emitUrlsSelected(const QList<QUrl> &files);
|
|
void _q_nativeCurrentChanged(const QUrl &file);
|
|
void _q_nativeEnterDirectory(const QUrl &directory);
|
|
void _q_goToDirectory(const QString &);
|
|
--
|
|
2.1.1
|
|
|