forked from pool/libqt5-qtbase
Accepting request 265462 from KDE:Qt5
Update to 5.4.0 OBS-URL: https://build.opensuse.org/request/show/265462 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=33
This commit is contained in:
parent
370761fb1a
commit
3ad6682989
@ -1,110 +0,0 @@
|
|||||||
From 820b20e593b7b0d92e6a78e7b23457f321aa0bc1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Allan Sandfeld Jensen <allan.jensen@digia.com>
|
|
||||||
Date: Thu, 24 Jul 2014 14:33:00 +0200
|
|
||||||
Subject: [PATCH 1/4] Add QFont strategy to disable subpixel antialiasing
|
|
||||||
|
|
||||||
This patch adds the option to disable subpixel antialiasing on QFont
|
|
||||||
basis. This can be useful when painting to offscreen surfaces. On OS X
|
|
||||||
this option disables the aggressive LCD font smoothing, which can be
|
|
||||||
necessary for certain fonts it may otherwise ruin.
|
|
||||||
|
|
||||||
Task-number: QTBUG-40396
|
|
||||||
Change-Id: I1664b636520ae63ee1503b5df7436748106b9f5c
|
|
||||||
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
|
|
||||||
(cherry picked from commit 7ff4621100b3df7ba9b336ac60204da4b548e642)
|
|
||||||
---
|
|
||||||
src/gui/text/qfont.cpp | 1 +
|
|
||||||
src/gui/text/qfont.h | 1 +
|
|
||||||
.../fontdatabases/fontconfig/qfontconfigdatabase.cpp | 4 +++-
|
|
||||||
src/plugins/platforms/cocoa/qpaintengine_mac.mm | 7 +++++++
|
|
||||||
src/plugins/platforms/windows/qwindowsfontdatabase.cpp | 4 +++-
|
|
||||||
5 files changed, 15 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
|
|
||||||
index cf40dd0..82676d7 100644
|
|
||||||
--- a/src/gui/text/qfont.cpp
|
|
||||||
+++ b/src/gui/text/qfont.cpp
|
|
||||||
@@ -1376,6 +1376,7 @@ QFont::StyleHint QFont::styleHint() const
|
|
||||||
\value PreferOutline prefers outline fonts (as opposed to bitmap fonts).
|
|
||||||
\value ForceOutline forces the use of outline fonts.
|
|
||||||
\value NoAntialias don't antialias the fonts.
|
|
||||||
+ \value NoSubpixelAntialias avoid subpixel antialiasing on the fonts if possible.
|
|
||||||
\value PreferAntialias antialias if possible.
|
|
||||||
\value OpenGLCompatible forces the use of OpenGL compatible
|
|
||||||
fonts.
|
|
||||||
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
|
|
||||||
index 7fbaf24..f48f4cf 100644
|
|
||||||
--- a/src/gui/text/qfont.h
|
|
||||||
+++ b/src/gui/text/qfont.h
|
|
||||||
@@ -83,6 +83,7 @@ public:
|
|
||||||
NoAntialias = 0x0100,
|
|
||||||
OpenGLCompatible = 0x0200,
|
|
||||||
ForceIntegerMetrics = 0x0400,
|
|
||||||
+ NoSubpixelAntialias = 0x0800,
|
|
||||||
NoFontMerging = 0x8000
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
|
|
||||||
index b8da972..e10e10b 100644
|
|
||||||
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
|
|
||||||
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
|
|
||||||
@@ -634,7 +634,9 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFontDef &f, void *usrPtr)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (antialias) {
|
|
||||||
- QFontEngineFT::SubpixelAntialiasingType subpixelType = subpixelTypeFromMatch(match);
|
|
||||||
+ QFontEngineFT::SubpixelAntialiasingType subpixelType = QFontEngineFT::Subpixel_None;
|
|
||||||
+ if (!(f.styleStrategy & QFont::NoSubpixelAntialias))
|
|
||||||
+ subpixelType = subpixelTypeFromMatch(match);
|
|
||||||
engine->subpixelType = subpixelType;
|
|
||||||
|
|
||||||
format = (subpixelType == QFontEngineFT::Subpixel_None)
|
|
||||||
diff --git a/src/plugins/platforms/cocoa/qpaintengine_mac.mm b/src/plugins/platforms/cocoa/qpaintengine_mac.mm
|
|
||||||
index f4cd071..d48cbdf 100644
|
|
||||||
--- a/src/plugins/platforms/cocoa/qpaintengine_mac.mm
|
|
||||||
+++ b/src/plugins/platforms/cocoa/qpaintengine_mac.mm
|
|
||||||
@@ -1084,6 +1084,10 @@ void QCoreGraphicsPaintEngine::drawTextItem(const QPointF &pos, const QTextItem
|
|
||||||
if (textAA != lineAA)
|
|
||||||
CGContextSetShouldAntialias(d->hd, textAA);
|
|
||||||
|
|
||||||
+ const bool smoothing = textAA && !(fe->fontDef.styleStrategy & QFont::NoSubpixelAntialias);
|
|
||||||
+ if (d->disabledSmoothFonts == smoothing)
|
|
||||||
+ CGContextSetShouldSmoothFonts(d->hd, smoothing);
|
|
||||||
+
|
|
||||||
if (ti.glyphs.numGlyphs) {
|
|
||||||
switch (fe->type()) {
|
|
||||||
case QFontEngine::Mac:
|
|
||||||
@@ -1100,6 +1104,9 @@ void QCoreGraphicsPaintEngine::drawTextItem(const QPointF &pos, const QTextItem
|
|
||||||
if (textAA != lineAA)
|
|
||||||
CGContextSetShouldAntialias(d->hd, !textAA);
|
|
||||||
|
|
||||||
+ if (smoothing == d->disabledSmoothFonts)
|
|
||||||
+ CGContextSetShouldSmoothFonts(d->hd, !d->disabledSmoothFonts);
|
|
||||||
+
|
|
||||||
updatePen(oldPen);
|
|
||||||
updateBrush(oldBrush, oldBrushOrigin);
|
|
||||||
}
|
|
||||||
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
|
|
||||||
index f30dcba..27262ec 100644
|
|
||||||
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
|
|
||||||
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
|
|
||||||
@@ -1521,13 +1521,15 @@ LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (request.styleStrategy & QFont::PreferAntialias) {
|
|
||||||
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP) {
|
|
||||||
+ if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && !(request.styleStrategy & QFont::NoSubpixelAntialias)) {
|
|
||||||
qual = CLEARTYPE_QUALITY;
|
|
||||||
} else {
|
|
||||||
qual = ANTIALIASED_QUALITY;
|
|
||||||
}
|
|
||||||
} else if (request.styleStrategy & QFont::NoAntialias) {
|
|
||||||
qual = NONANTIALIASED_QUALITY;
|
|
||||||
+ } else if ((request.styleStrategy & QFont::NoSubpixelAntialias) && sharedFontData()->clearTypeEnabled) {
|
|
||||||
+ qual = ANTIALIASED_QUALITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
lf.lfQuality = qual;
|
|
||||||
--
|
|
||||||
2.1.1
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
|||||||
From 0ac4019528888aba8528432434300341df732c4e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marco Martin <mart@kde.org>
|
|
||||||
Date: Tue, 14 Oct 2014 16:55:17 +0200
|
|
||||||
Subject: [PATCH 1/4] Allow panels outside of availableGeometry
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Panels windows are usually outside QScreen::availableGeometry, because
|
|
||||||
they will usually set extended struts to reserve the screen area for
|
|
||||||
themselves, but their own screen() must remain the one in which they
|
|
||||||
are.
|
|
||||||
This cause one downstream behavior to KDE
|
|
||||||
https://bugs.kde.org/show_bug.cgi?id=339846
|
|
||||||
in which a panel got by mistake few pixels on another screen, and
|
|
||||||
was immediately reassigned to that screen, because its geometry was
|
|
||||||
intersecting the new screen availableGeometry() but not the geometry
|
|
||||||
of its own screen, because itself reserved its own geometry away
|
|
||||||
from availableGeometry()
|
|
||||||
|
|
||||||
Change-Id: If6c9defdef62732473687dd336dbcec582bd0ea2
|
|
||||||
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
|
|
||||||
(cherry picked from commit 47ec22a50975d6f616043fc12424ae1e12e584bd)
|
|
||||||
---
|
|
||||||
src/plugins/platforms/xcb/qxcbwindow.cpp | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
|
|
||||||
index 586068d8d9ed9c1987e51d664f76d4f33769f293..a99a5cfab51861b2c64ad552709f5d0bd39a62f3 100644
|
|
||||||
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
|
|
||||||
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
|
|
||||||
@@ -1687,9 +1687,9 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
|
|
||||||
QPlatformWindow::setGeometry(rect);
|
|
||||||
QWindowSystemInterface::handleGeometryChange(window(), rect);
|
|
||||||
|
|
||||||
- if (!m_screen->availableGeometry().intersects(rect)) {
|
|
||||||
+ if (!m_screen->geometry().intersects(rect)) {
|
|
||||||
Q_FOREACH (QPlatformScreen* screen, m_screen->virtualSiblings()) {
|
|
||||||
- if (screen->availableGeometry().intersects(rect)) {
|
|
||||||
+ if (screen->geometry().intersects(rect)) {
|
|
||||||
m_screen = static_cast<QXcbScreen*>(screen);
|
|
||||||
QWindowSystemInterface::handleWindowScreenChanged(window(), m_screen->QPlatformScreen::screen());
|
|
||||||
break;
|
|
||||||
--
|
|
||||||
2.1.2
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
@ -1,339 +0,0 @@
|
|||||||
From 17bc5a22d5b3c289478f6fb91cd344708d957078 Mon Sep 17 00:00:00 2001
|
|
||||||
From: J-P Nurmi <jpnurmi@digia.com>
|
|
||||||
Date: Thu, 6 Feb 2014 17:14:25 +0100
|
|
||||||
Subject: [PATCH 1/1] QKdeTheme: use system-wide kdeglobals as a fallback
|
|
||||||
|
|
||||||
Determine KDE prefixes in the following priority order:
|
|
||||||
- KDEHOME and KDEDIRS environment variables
|
|
||||||
- ~/.kde(<version>)
|
|
||||||
- read prefixes from /etc/kde<version>rc
|
|
||||||
- fallback to /etc/kde<version>
|
|
||||||
|
|
||||||
Task-number: QTBUG-36184
|
|
||||||
Change-Id: I9010ea485f1954b21bda73b02993dbddef67eb1d
|
|
||||||
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
|
|
||||||
Reviewed-by: David Faure <david.faure@kdab.com>
|
|
||||||
(cherry picked from commit eedd300b0ecf83a365f48c084e09f1446238e157)
|
|
||||||
---
|
|
||||||
.../themes/genericunix/qgenericunixthemes.cpp | 167 +++++++++++++--------
|
|
||||||
.../themes/genericunix/qgenericunixthemes_p.h | 2 +-
|
|
||||||
2 files changed, 103 insertions(+), 66 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
|
||||||
index b68aa85..dac417a 100644
|
|
||||||
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
|
||||||
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
|
||||||
@@ -51,6 +51,7 @@
|
|
||||||
#include <QtCore/QFileInfo>
|
|
||||||
#include <QtCore/QFile>
|
|
||||||
#include <QtCore/QDebug>
|
|
||||||
+#include <QtCore/QHash>
|
|
||||||
#include <QtCore/QSettings>
|
|
||||||
#include <QtCore/QVariant>
|
|
||||||
#include <QtCore/QStringList>
|
|
||||||
@@ -171,26 +172,26 @@ QVariant QGenericUnixTheme::themeHint(ThemeHint hint) const
|
|
||||||
class QKdeThemePrivate : public QPlatformThemePrivate
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
- QKdeThemePrivate(const QString &kdeHome, int kdeVersion)
|
|
||||||
- : kdeHome(kdeHome)
|
|
||||||
+ QKdeThemePrivate(const QStringList &kdeDirs, int kdeVersion)
|
|
||||||
+ : kdeDirs(kdeDirs)
|
|
||||||
, kdeVersion(kdeVersion)
|
|
||||||
, toolButtonStyle(Qt::ToolButtonTextBesideIcon)
|
|
||||||
, toolBarIconSize(0)
|
|
||||||
, singleClick(true)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
- QString globalSettingsFile() const
|
|
||||||
+ static QString kdeGlobals(const QString &kdeDir)
|
|
||||||
{
|
|
||||||
- return kdeHome + QStringLiteral("/share/config/kdeglobals");
|
|
||||||
+ return kdeDir + QStringLiteral("/share/config/kdeglobals");
|
|
||||||
}
|
|
||||||
|
|
||||||
void refresh();
|
|
||||||
- static void readKdeSystemPalette(const QSettings &kdeSettings, QPalette *pal);
|
|
||||||
- static QFont *readKdeFontSetting(const QSettings &settings, const QString &key);
|
|
||||||
- static QStringList kdeIconThemeSearchPaths(const QString &kdeHome);
|
|
||||||
+ static QVariant readKdeSetting(const QString &key, const QStringList &kdeDirs, QHash<QString, QSettings*> &kdeSettings);
|
|
||||||
+ static void readKdeSystemPalette(const QStringList &kdeDirs, QHash<QString, QSettings*> &kdeSettings, QPalette *pal);
|
|
||||||
+ static QFont *kdeFont(const QVariant &fontValue);
|
|
||||||
+ static QStringList kdeIconThemeSearchPaths(const QStringList &kdeDirs);
|
|
||||||
|
|
||||||
-
|
|
||||||
- const QString kdeHome;
|
|
||||||
+ const QStringList kdeDirs;
|
|
||||||
const int kdeVersion;
|
|
||||||
|
|
||||||
ResourceHelper resources;
|
|
||||||
@@ -212,36 +213,33 @@ void QKdeThemePrivate::refresh()
|
|
||||||
styleNames << QStringLiteral("Oxygen") << QStringLiteral("fusion") << QStringLiteral("windows");
|
|
||||||
iconFallbackThemeName = iconThemeName = QStringLiteral("oxygen");
|
|
||||||
|
|
||||||
- // Read settings file.
|
|
||||||
- const QString settingsFile = globalSettingsFile();
|
|
||||||
- if (!QFileInfo(settingsFile).isReadable())
|
|
||||||
- return;
|
|
||||||
-
|
|
||||||
- const QSettings kdeSettings(settingsFile, QSettings::IniFormat);
|
|
||||||
+ QHash<QString, QSettings*> kdeSettings;
|
|
||||||
|
|
||||||
QPalette systemPalette = QPalette();
|
|
||||||
- readKdeSystemPalette(kdeSettings, &systemPalette);
|
|
||||||
+ readKdeSystemPalette(kdeDirs, kdeSettings, &systemPalette);
|
|
||||||
resources.palettes[QPlatformTheme::SystemPalette] = new QPalette(systemPalette);
|
|
||||||
//## TODO tooltip color
|
|
||||||
|
|
||||||
- const QVariant styleValue = kdeSettings.value(QStringLiteral("widgetStyle"));
|
|
||||||
+ const QVariant styleValue = readKdeSetting(QStringLiteral("widgetStyle"), kdeDirs, kdeSettings);
|
|
||||||
if (styleValue.isValid()) {
|
|
||||||
const QString style = styleValue.toString();
|
|
||||||
if (style != styleNames.front())
|
|
||||||
styleNames.push_front(style);
|
|
||||||
}
|
|
||||||
|
|
||||||
- singleClick = kdeSettings.value(QStringLiteral("KDE/SingleClick"), true).toBool();
|
|
||||||
+ const QVariant singleClickValue = readKdeSetting(QStringLiteral("KDE/SingleClick"), kdeDirs, kdeSettings);
|
|
||||||
+ if (singleClickValue.isValid())
|
|
||||||
+ singleClick = singleClickValue.toBool();
|
|
||||||
|
|
||||||
- const QVariant themeValue = kdeSettings.value(QStringLiteral("Icons/Theme"));
|
|
||||||
+ const QVariant themeValue = readKdeSetting(QStringLiteral("Icons/Theme"), kdeDirs, kdeSettings);
|
|
||||||
if (themeValue.isValid())
|
|
||||||
iconThemeName = themeValue.toString();
|
|
||||||
|
|
||||||
- const QVariant toolBarIconSizeValue = kdeSettings.value(QStringLiteral("ToolbarIcons/Size"));
|
|
||||||
+ const QVariant toolBarIconSizeValue = readKdeSetting(QStringLiteral("ToolbarIcons/Size"), kdeDirs, kdeSettings);
|
|
||||||
if (toolBarIconSizeValue.isValid())
|
|
||||||
toolBarIconSize = toolBarIconSizeValue.toInt();
|
|
||||||
|
|
||||||
- const QVariant toolbarStyleValue = kdeSettings.value(QStringLiteral("ToolButtonStyle"));
|
|
||||||
+ const QVariant toolbarStyleValue = readKdeSetting(QStringLiteral("Toolbar style/ToolButtonStyle"), kdeDirs, kdeSettings);
|
|
||||||
if (toolbarStyleValue.isValid()) {
|
|
||||||
const QString toolBarStyle = toolbarStyleValue.toString();
|
|
||||||
if (toolBarStyle == QStringLiteral("TextBesideIcon"))
|
|
||||||
@@ -253,26 +251,46 @@ void QKdeThemePrivate::refresh()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read system font, ignore 'smallestReadableFont'
|
|
||||||
- if (QFont *systemFont = readKdeFontSetting(kdeSettings, QStringLiteral("font")))
|
|
||||||
+ if (QFont *systemFont = kdeFont(readKdeSetting(QStringLiteral("font"), kdeDirs, kdeSettings)))
|
|
||||||
resources.fonts[QPlatformTheme::SystemFont] = systemFont;
|
|
||||||
else
|
|
||||||
resources.fonts[QPlatformTheme::SystemFont] = new QFont(QLatin1String(defaultSystemFontNameC), defaultSystemFontSize);
|
|
||||||
|
|
||||||
- if (QFont *fixedFont = readKdeFontSetting(kdeSettings, QStringLiteral("fixed"))) {
|
|
||||||
+ if (QFont *fixedFont = kdeFont(readKdeSetting(QStringLiteral("fixed"), kdeDirs, kdeSettings))) {
|
|
||||||
resources.fonts[QPlatformTheme::FixedFont] = fixedFont;
|
|
||||||
} else {
|
|
||||||
fixedFont = new QFont(QLatin1String(defaultSystemFontNameC), defaultSystemFontSize);
|
|
||||||
fixedFont->setStyleHint(QFont::TypeWriter);
|
|
||||||
resources.fonts[QPlatformTheme::FixedFont] = fixedFont;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ qDeleteAll(kdeSettings);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+QVariant QKdeThemePrivate::readKdeSetting(const QString &key, const QStringList &kdeDirs, QHash<QString, QSettings*> &kdeSettings)
|
|
||||||
+{
|
|
||||||
+ foreach (const QString &kdeDir, kdeDirs) {
|
|
||||||
+ QSettings *settings = kdeSettings.value(kdeDir);
|
|
||||||
+ if (!settings) {
|
|
||||||
+ const QString kdeGlobalsPath = kdeGlobals(kdeDir);
|
|
||||||
+ if (QFileInfo(kdeGlobalsPath).isReadable()) {
|
|
||||||
+ settings = new QSettings(kdeGlobalsPath, QSettings::IniFormat);
|
|
||||||
+ kdeSettings.insert(kdeDir, settings);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ if (settings) {
|
|
||||||
+ const QVariant value = settings->value(key);
|
|
||||||
+ if (value.isValid())
|
|
||||||
+ return value;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return QVariant();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reads the color from the KDE configuration, and store it in the
|
|
||||||
// palette with the given color role if found.
|
|
||||||
-static inline bool kdeColor(QPalette *pal, QPalette::ColorRole role,
|
|
||||||
- const QSettings &kdeSettings, const QString &key)
|
|
||||||
+static inline bool kdeColor(QPalette *pal, QPalette::ColorRole role, const QVariant &value)
|
|
||||||
{
|
|
||||||
- const QVariant value = kdeSettings.value(key);
|
|
||||||
if (!value.isValid())
|
|
||||||
return false;
|
|
||||||
const QStringList values = value.toStringList();
|
|
||||||
@@ -282,9 +300,9 @@ static inline bool kdeColor(QPalette *pal, QPalette::ColorRole role,
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
-void QKdeThemePrivate::readKdeSystemPalette(const QSettings &kdeSettings, QPalette *pal)
|
|
||||||
+void QKdeThemePrivate::readKdeSystemPalette(const QStringList &kdeDirs, QHash<QString, QSettings*> &kdeSettings, QPalette *pal)
|
|
||||||
{
|
|
||||||
- if (!kdeSettings.contains(QStringLiteral("Colors:Button/BackgroundNormal"))) {
|
|
||||||
+ if (!kdeColor(pal, QPalette::Button, readKdeSetting(QStringLiteral("Colors:Button/BackgroundNormal"), kdeDirs, kdeSettings))) {
|
|
||||||
// kcolorscheme.cpp: SetDefaultColors
|
|
||||||
const QColor defaultWindowBackground(214, 210, 208);
|
|
||||||
const QColor defaultButtonBackground(223, 220, 217);
|
|
||||||
@@ -292,19 +310,18 @@ void QKdeThemePrivate::readKdeSystemPalette(const QSettings &kdeSettings, QPalet
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
- kdeColor(pal, QPalette::Button, kdeSettings, QStringLiteral("Colors:Button/BackgroundNormal"));
|
|
||||||
- kdeColor(pal, QPalette::Window, kdeSettings, QStringLiteral("Colors:Window/BackgroundNormal"));
|
|
||||||
- kdeColor(pal, QPalette::Text, kdeSettings, QStringLiteral("Colors:View/ForegroundNormal"));
|
|
||||||
- kdeColor(pal, QPalette::WindowText, kdeSettings, QStringLiteral("Colors:Window/ForegroundNormal"));
|
|
||||||
- kdeColor(pal, QPalette::Base, kdeSettings, QStringLiteral("Colors:View/BackgroundNormal"));
|
|
||||||
- kdeColor(pal, QPalette::Highlight, kdeSettings, QStringLiteral("Colors:Selection/BackgroundNormal"));
|
|
||||||
- kdeColor(pal, QPalette::HighlightedText, kdeSettings, QStringLiteral("Colors:Selection/ForegroundNormal"));
|
|
||||||
- kdeColor(pal, QPalette::AlternateBase, kdeSettings, QStringLiteral("Colors:View/BackgroundAlternate"));
|
|
||||||
- kdeColor(pal, QPalette::ButtonText, kdeSettings, QStringLiteral("Colors:Button/ForegroundNormal"));
|
|
||||||
- kdeColor(pal, QPalette::Link, kdeSettings, QStringLiteral("Colors:View/ForegroundLink"));
|
|
||||||
- kdeColor(pal, QPalette::LinkVisited, kdeSettings, QStringLiteral("Colors:View/ForegroundVisited"));
|
|
||||||
- kdeColor(pal, QPalette::ToolTipBase, kdeSettings, QStringLiteral("Colors:Tooltip/BackgroundNormal"));
|
|
||||||
- kdeColor(pal, QPalette::ToolTipText, kdeSettings, QStringLiteral("Colors:Tooltip/ForegroundNormal"));
|
|
||||||
+ kdeColor(pal, QPalette::Window, readKdeSetting(QStringLiteral("Colors:Window/BackgroundNormal"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::Text, readKdeSetting(QStringLiteral("Colors:View/ForegroundNormal"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::WindowText, readKdeSetting(QStringLiteral("Colors:Window/ForegroundNormal"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::Base, readKdeSetting(QStringLiteral("Colors:View/BackgroundNormal"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::Highlight, readKdeSetting(QStringLiteral("Colors:Selection/BackgroundNormal"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::HighlightedText, readKdeSetting(QStringLiteral("Colors:Selection/ForegroundNormal"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::AlternateBase, readKdeSetting(QStringLiteral("Colors:View/BackgroundAlternate"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::ButtonText, readKdeSetting(QStringLiteral("Colors:Button/ForegroundNormal"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::Link, readKdeSetting(QStringLiteral("Colors:View/ForegroundLink"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::LinkVisited, readKdeSetting(QStringLiteral("Colors:View/ForegroundVisited"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::ToolTipBase, readKdeSetting(QStringLiteral("Colors:Tooltip/BackgroundNormal"), kdeDirs, kdeSettings));
|
|
||||||
+ kdeColor(pal, QPalette::ToolTipText, readKdeSetting(QStringLiteral("Colors:Tooltip/ForegroundNormal"), kdeDirs, kdeSettings));
|
|
||||||
|
|
||||||
// The above code sets _all_ color roles to "normal" colors. In KDE, the disabled
|
|
||||||
// color roles are calculated by applying various effects described in kdeglobals.
|
|
||||||
@@ -347,15 +364,14 @@ void QKdeThemePrivate::readKdeSystemPalette(const QSettings &kdeSettings, QPalet
|
|
||||||
|
|
||||||
const char *QKdeTheme::name = "kde";
|
|
||||||
|
|
||||||
-QKdeTheme::QKdeTheme(const QString &kdeHome, int kdeVersion)
|
|
||||||
- : QPlatformTheme(new QKdeThemePrivate(kdeHome,kdeVersion))
|
|
||||||
+QKdeTheme::QKdeTheme(const QStringList& kdeDirs, int kdeVersion)
|
|
||||||
+ : QPlatformTheme(new QKdeThemePrivate(kdeDirs,kdeVersion))
|
|
||||||
{
|
|
||||||
d_func()->refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
-QFont *QKdeThemePrivate::readKdeFontSetting(const QSettings &settings, const QString &key)
|
|
||||||
+QFont *QKdeThemePrivate::kdeFont(const QVariant &fontValue)
|
|
||||||
{
|
|
||||||
- const QVariant fontValue = settings.value(key);
|
|
||||||
if (fontValue.isValid()) {
|
|
||||||
// Read font value: Might be a QStringList as KDE stores fonts without quotes.
|
|
||||||
// Also retrieve the family for the constructor since we cannot use the
|
|
||||||
@@ -382,16 +398,11 @@ QFont *QKdeThemePrivate::readKdeFontSetting(const QSettings &settings, const QSt
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-QStringList QKdeThemePrivate::kdeIconThemeSearchPaths(const QString &kdeHome)
|
|
||||||
+QStringList QKdeThemePrivate::kdeIconThemeSearchPaths(const QStringList &kdeDirs)
|
|
||||||
{
|
|
||||||
- QStringList candidates = QStringList(kdeHome);
|
|
||||||
- const QString kdeDirs = QFile::decodeName(qgetenv("KDEDIRS"));
|
|
||||||
- if (!kdeDirs.isEmpty())
|
|
||||||
- candidates.append(kdeDirs.split(QLatin1Char(':')));
|
|
||||||
-
|
|
||||||
QStringList paths = QGenericUnixTheme::xdgIconThemePaths();
|
|
||||||
const QString iconPath = QStringLiteral("/share/icons");
|
|
||||||
- foreach (const QString &candidate, candidates) {
|
|
||||||
+ foreach (const QString &candidate, kdeDirs) {
|
|
||||||
const QFileInfo fi(candidate + iconPath);
|
|
||||||
if (fi.isDir())
|
|
||||||
paths.append(fi.absoluteFilePath());
|
|
||||||
@@ -418,7 +429,7 @@ QVariant QKdeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
|
|
||||||
case QPlatformTheme::SystemIconFallbackThemeName:
|
|
||||||
return QVariant(d->iconFallbackThemeName);
|
|
||||||
case QPlatformTheme::IconThemeSearchPaths:
|
|
||||||
- return QVariant(d->kdeIconThemeSearchPaths(d->kdeHome));
|
|
||||||
+ return QVariant(d->kdeIconThemeSearchPaths(d->kdeDirs));
|
|
||||||
case QPlatformTheme::StyleNames:
|
|
||||||
return QVariant(d->styleNames);
|
|
||||||
case QPlatformTheme::KeyboardScheme:
|
|
||||||
@@ -445,26 +456,52 @@ const QFont *QKdeTheme::font(Font type) const
|
|
||||||
|
|
||||||
QPlatformTheme *QKdeTheme::createKdeTheme()
|
|
||||||
{
|
|
||||||
- // Check for version >= 4 and determine home folder from environment,
|
|
||||||
- // defaulting to ~/.kde<version>, ~/.kde
|
|
||||||
const QByteArray kdeVersionBA = qgetenv("KDE_SESSION_VERSION");
|
|
||||||
const int kdeVersion = kdeVersionBA.toInt();
|
|
||||||
if (kdeVersion < 4)
|
|
||||||
return 0;
|
|
||||||
- const QString kdeHomePathVar = QString::fromLocal8Bit(qgetenv("KDEHOME"));
|
|
||||||
+
|
|
||||||
+ // Determine KDE prefixes in the following priority order:
|
|
||||||
+ // - KDEHOME and KDEDIRS environment variables
|
|
||||||
+ // - ~/.kde(<version>)
|
|
||||||
+ // - read prefixes from /etc/kde<version>rc
|
|
||||||
+ // - fallback to /etc/kde<version>
|
|
||||||
+
|
|
||||||
+ QStringList kdeDirs;
|
|
||||||
+ const QString kdeHomePathVar = QFile::decodeName(qgetenv("KDEHOME"));
|
|
||||||
if (!kdeHomePathVar.isEmpty())
|
|
||||||
- return new QKdeTheme(kdeHomePathVar, kdeVersion);
|
|
||||||
+ kdeDirs += kdeHomePathVar;
|
|
||||||
+
|
|
||||||
+ const QString kdeDirsVar = QFile::decodeName(qgetenv("KDEDIRS"));
|
|
||||||
+ if (!kdeDirsVar.isEmpty())
|
|
||||||
+ kdeDirs += kdeDirsVar.split(QLatin1Char(':'), QString::SkipEmptyParts);
|
|
||||||
+
|
|
||||||
+ const QString kdeVersionHomePath = QDir::homePath() + QStringLiteral("/.kde") + QLatin1String(kdeVersionBA);
|
|
||||||
+ if (QFileInfo(kdeVersionHomePath).isDir())
|
|
||||||
+ kdeDirs += kdeVersionHomePath;
|
|
||||||
|
|
||||||
- const QString kdeVersionHomePath = QDir::homePath() + QStringLiteral("/.kde") + QLatin1String(kdeVersionBA);
|
|
||||||
- if (QFileInfo(kdeVersionHomePath).isDir())
|
|
||||||
- return new QKdeTheme(kdeVersionHomePath, kdeVersion);
|
|
||||||
+ const QString kdeHomePath = QDir::homePath() + QStringLiteral("/.kde");
|
|
||||||
+ if (QFileInfo(kdeHomePath).isDir())
|
|
||||||
+ kdeDirs += kdeHomePath;
|
|
||||||
|
|
||||||
- const QString kdeHomePath = QDir::homePath() + QStringLiteral("/.kde");
|
|
||||||
- if (QFileInfo(kdeHomePath).isDir())
|
|
||||||
- return new QKdeTheme(kdeHomePath, kdeVersion);
|
|
||||||
+ const QString kdeRcPath = QStringLiteral("/etc/kde") + QLatin1String(kdeVersionBA) + QStringLiteral("rc");
|
|
||||||
+ if (QFileInfo(kdeRcPath).isReadable()) {
|
|
||||||
+ QSettings kdeSettings(kdeRcPath, QSettings::IniFormat);
|
|
||||||
+ kdeSettings.beginGroup(QStringLiteral("Directories-default"));
|
|
||||||
+ kdeDirs += kdeSettings.value(QStringLiteral("prefixes")).toStringList();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ const QString kdeVersionPrefix = QStringLiteral("/etc/kde") + QLatin1String(kdeVersionBA);
|
|
||||||
+ if (QFileInfo(kdeVersionPrefix).isDir())
|
|
||||||
+ kdeDirs += kdeVersionPrefix;
|
|
||||||
+
|
|
||||||
+ kdeDirs.removeDuplicates();
|
|
||||||
+ if (kdeDirs.isEmpty()) {
|
|
||||||
+ qWarning("%s: Unable to determine KDE dirs", Q_FUNC_INFO);
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- qWarning("%s: Unable to determine KDEHOME", Q_FUNC_INFO);
|
|
||||||
- return 0;
|
|
||||||
+ return new QKdeTheme(kdeDirs, kdeVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // QT_NO_SETTINGS
|
|
||||||
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
|
|
||||||
index fd65402..509a26d 100644
|
|
||||||
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
|
|
||||||
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
|
|
||||||
@@ -87,7 +87,7 @@ class QKdeTheme : public QPlatformTheme
|
|
||||||
{
|
|
||||||
Q_DECLARE_PRIVATE(QKdeTheme)
|
|
||||||
public:
|
|
||||||
- QKdeTheme(const QString &kdeHome, int kdeVersion);
|
|
||||||
+ QKdeTheme(const QStringList& kdeDirs, int kdeVersion);
|
|
||||||
|
|
||||||
static QPlatformTheme *createKdeTheme();
|
|
||||||
virtual QVariant themeHint(ThemeHint hint) const;
|
|
||||||
--
|
|
||||||
2.1.1
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
|||||||
From eda5c8ede9fd35117146d13f1b55775c9007b672 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thiago Macieira <thiago.macieira@intel.com>
|
|
||||||
Date: Mon, 30 Jun 2014 08:31:22 -0700
|
|
||||||
Subject: [PATCH 1/1] Replace the const QString global static with a
|
|
||||||
QStringLiteral
|
|
||||||
|
|
||||||
It was originally created to avoid allocating memory for the QString at
|
|
||||||
every turn, but we have QStringLiteral for that today. It has also
|
|
||||||
served a very good run by catching qatomic.h implementations that had
|
|
||||||
bad cv qualifications.
|
|
||||||
|
|
||||||
Change-Id: Id6d952b8cce363015ec2611d346b4cccedecf137
|
|
||||||
---
|
|
||||||
src/dbus/qdbusintegrator.cpp | 14 ++++++++++----
|
|
||||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
|
|
||||||
index d4079e8..bc28d50 100644
|
|
||||||
--- a/src/dbus/qdbusintegrator.cpp
|
|
||||||
+++ b/src/dbus/qdbusintegrator.cpp
|
|
||||||
@@ -76,15 +76,21 @@ QT_BEGIN_NAMESPACE
|
|
||||||
static QBasicAtomicInt isDebugging = Q_BASIC_ATOMIC_INITIALIZER(-1);
|
|
||||||
#define qDBusDebug if (::isDebugging == 0); else qDebug
|
|
||||||
|
|
||||||
-Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS)))
|
|
||||||
+QString orgFreedesktopDBusString()
|
|
||||||
+{
|
|
||||||
+ return QStringLiteral(DBUS_SERVICE_DBUS);
|
|
||||||
+}
|
|
||||||
|
|
||||||
static inline QString dbusServiceString()
|
|
||||||
-{ return *orgFreedesktopDBusString(); }
|
|
||||||
+{
|
|
||||||
+ return orgFreedesktopDBusString();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static inline QString dbusInterfaceString()
|
|
||||||
{
|
|
||||||
// it's the same string, but just be sure
|
|
||||||
- Q_ASSERT(*orgFreedesktopDBusString() == QLatin1String(DBUS_INTERFACE_DBUS));
|
|
||||||
- return *orgFreedesktopDBusString();
|
|
||||||
+ Q_ASSERT(orgFreedesktopDBusString() == QLatin1String(DBUS_INTERFACE_DBUS));
|
|
||||||
+ return orgFreedesktopDBusString();
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline QDebug operator<<(QDebug dbg, const QThread *th)
|
|
||||||
--
|
|
||||||
1.8.4.5
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
From 2160e7e0b7842d4ef49fdd435b4a7f127d479b90 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jakub Adam <jakub.adam@jollamobile.com>
|
|
||||||
Date: Wed, 4 Jun 2014 14:48:02 +0200
|
|
||||||
Subject: [PATCH] Use correct signal name when disconnecting "NameOwnerChanged"
|
|
||||||
|
|
||||||
A disconnectSignal() call with a wrong signal name caused that hook
|
|
||||||
wasn't found and thus kept in QDBusConnectionPrivate::signalHooks
|
|
||||||
forever.
|
|
||||||
|
|
||||||
Change-Id: Id7cda225be7580529fc835b377636226abb229f9
|
|
||||||
---
|
|
||||||
src/dbus/qdbusintegrator.cpp | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
|
|
||||||
index 1fef6d4..d4079e8 100644
|
|
||||||
--- a/src/dbus/qdbusintegrator.cpp
|
|
||||||
+++ b/src/dbus/qdbusintegrator.cpp
|
|
||||||
@@ -2272,7 +2272,7 @@ QDBusConnectionPrivate::disconnectSignal
|
|
||||||
watchedServices.erase(sit);
|
|
||||||
disconnectSignal(dbusServiceString(), QString(), dbusInterfaceString(),
|
|
||||||
QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(),
|
|
||||||
- this, SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
|
|
||||||
+ this, SLOT(serviceOwnerChangedNoLock(QString,QString,QString)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.0.1
|
|
@ -1,96 +0,0 @@
|
|||||||
From 596a3d701bfb96de01ff2e127cd628c6b50fd9d6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thiago Macieira <thiago.macieira@intel.com>
|
|
||||||
Date: Tue, 28 Oct 2014 17:23:09 -0700
|
|
||||||
Subject: [PATCH 2/4] Always lock the DBus dispatcher before
|
|
||||||
dbus_connection_send*
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
We lock it before dbus_connection_send_with_reply (the async version) in
|
|
||||||
QDBusConnectionPrivate::sendWithReplyAsync. We weren't locking it before
|
|
||||||
send_with_reply_and_block and we apparently should. The locking around
|
|
||||||
the dbus_connection_send function might not be necessary, but let's do
|
|
||||||
it to be safe.
|
|
||||||
|
|
||||||
The lock now needs to be recursive because we may be inside
|
|
||||||
QDBusConnectionPrivate::doDispatch.
|
|
||||||
|
|
||||||
Task-number: QTBUG-42189
|
|
||||||
Change-Id: I7b6b350909359817ea8b3f9c693bced042c9779a
|
|
||||||
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
|
|
||||||
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
|
|
||||||
(cherry picked from commit 6a2bdc4ee2dc49b5d89d09a1f255a7a0e2f18acf)
|
|
||||||
---
|
|
||||||
src/dbus/qdbusintegrator.cpp | 19 +++++++++++++++----
|
|
||||||
src/dbus/qdbusthreaddebug_p.h | 3 +++
|
|
||||||
2 files changed, 18 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
|
|
||||||
index 8f088443169ff6be013d77b149995f556196d588..03f9eef96ed160b8b6df888661d5c1bd5840047b 100644
|
|
||||||
--- a/src/dbus/qdbusintegrator.cpp
|
|
||||||
+++ b/src/dbus/qdbusintegrator.cpp
|
|
||||||
@@ -1023,7 +1023,7 @@ extern bool qDBusInitThreads();
|
|
||||||
|
|
||||||
QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
|
|
||||||
: QObject(p), ref(1), capabilities(0), mode(InvalidMode), connection(0), server(0), busService(0),
|
|
||||||
- watchAndTimeoutLock(QMutex::Recursive),
|
|
||||||
+ watchAndTimeoutLock(QMutex::Recursive), dispatchLock(QMutex::Recursive),
|
|
||||||
rootNode(QString(QLatin1Char('/'))),
|
|
||||||
anonymousAuthenticationAllowed(false)
|
|
||||||
{
|
|
||||||
@@ -1272,7 +1272,10 @@ void QDBusConnectionPrivate::relaySignal(QObject *obj, const QMetaObject *mo, in
|
|
||||||
//qDBusDebug() << "Emitting signal" << message;
|
|
||||||
//qDBusDebug() << "for paths:";
|
|
||||||
q_dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything
|
|
||||||
- huntAndEmit(connection, msg, obj, rootNode, isScriptable, isAdaptor);
|
|
||||||
+ {
|
|
||||||
+ QDBusDispatchLocker locker(HuntAndEmitAction, this);
|
|
||||||
+ huntAndEmit(connection, msg, obj, rootNode, isScriptable, isAdaptor);
|
|
||||||
+ }
|
|
||||||
q_dbus_message_unref(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1929,7 +1932,11 @@ int QDBusConnectionPrivate::send(const QDBusMessage& message)
|
|
||||||
|
|
||||||
qDBusDebug() << this << "sending message (no reply):" << message;
|
|
||||||
checkThread();
|
|
||||||
- bool isOk = q_dbus_connection_send(connection, msg, 0);
|
|
||||||
+ bool isOk;
|
|
||||||
+ {
|
|
||||||
+ QDBusDispatchLocker locker(SendMessageAction, this);
|
|
||||||
+ isOk = q_dbus_connection_send(connection, msg, 0);
|
|
||||||
+ }
|
|
||||||
int serial = 0;
|
|
||||||
if (isOk)
|
|
||||||
serial = q_dbus_message_get_serial(msg);
|
|
||||||
@@ -1961,7 +1968,11 @@ QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message,
|
|
||||||
|
|
||||||
qDBusDebug() << this << "sending message (blocking):" << message;
|
|
||||||
QDBusErrorInternal error;
|
|
||||||
- DBusMessage *reply = q_dbus_connection_send_with_reply_and_block(connection, msg, timeout, error);
|
|
||||||
+ DBusMessage *reply;
|
|
||||||
+ {
|
|
||||||
+ QDBusDispatchLocker locker(SendWithReplyAndBlockAction, this);
|
|
||||||
+ reply = q_dbus_connection_send_with_reply_and_block(connection, msg, timeout, error);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
q_dbus_message_unref(msg);
|
|
||||||
|
|
||||||
diff --git a/src/dbus/qdbusthreaddebug_p.h b/src/dbus/qdbusthreaddebug_p.h
|
|
||||||
index f9039ef3cd3925c4484686c1d73c2c3f5499dfff..dcde99169cc15424c7cfa0acf3fd18272ef12aca 100644
|
|
||||||
--- a/src/dbus/qdbusthreaddebug_p.h
|
|
||||||
+++ b/src/dbus/qdbusthreaddebug_p.h
|
|
||||||
@@ -94,6 +94,9 @@ enum ThreadAction {
|
|
||||||
MessageResultReceivedAction = 26,
|
|
||||||
ActivateSignalAction = 27,
|
|
||||||
PendingCallBlockAction = 28,
|
|
||||||
+ SendMessageAction = 29,
|
|
||||||
+ SendWithReplyAndBlockAction = 30,
|
|
||||||
+ HuntAndEmitAction = 31,
|
|
||||||
|
|
||||||
AddTimeoutAction = 50,
|
|
||||||
RealAddTimeoutAction = 51,
|
|
||||||
--
|
|
||||||
2.1.2
|
|
||||||
|
|
@ -1,254 +0,0 @@
|
|||||||
From 6528af73e7e3fda1c3abdebac1d9dc13aba8af10 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Allan Sandfeld Jensen <allan.jensen@digia.com>
|
|
||||||
Date: Wed, 13 Aug 2014 12:19:30 +0200
|
|
||||||
Subject: [PATCH 2/4] Move SubpixelAntialiasingType from QFontEngineFT to
|
|
||||||
QFontEngine
|
|
||||||
|
|
||||||
To be able to use the SubpixelAntialiasingType enum without depending
|
|
||||||
on QFontEngineFT we need to move it to QFontEngine.
|
|
||||||
|
|
||||||
The patch also cleans up the left-overs of other enums moved the same
|
|
||||||
way.
|
|
||||||
|
|
||||||
Change-Id: I025bc8a5b429d376cfab0a643121ed6f99204988
|
|
||||||
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
|
|
||||||
(cherry picked from commit 9e1d6eec8eb7e393d1d0cc7efd24629e80b59289)
|
|
||||||
---
|
|
||||||
src/gui/text/qfontengine_ft.cpp | 12 ++---
|
|
||||||
src/gui/text/qfontengine_ft_p.h | 8 ---
|
|
||||||
src/gui/text/qfontengine_p.h | 8 +++
|
|
||||||
.../fontconfig/qfontconfigdatabase.cpp | 60 +++++++++++-----------
|
|
||||||
4 files changed, 44 insertions(+), 44 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
|
|
||||||
index f5ca559..ad4276b 100644
|
|
||||||
--- a/src/gui/text/qfontengine_ft.cpp
|
|
||||||
+++ b/src/gui/text/qfontengine_ft.cpp
|
|
||||||
@@ -813,11 +813,11 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags,
|
|
||||||
if (format == Format_Mono) {
|
|
||||||
load_target = FT_LOAD_TARGET_MONO;
|
|
||||||
} else if (format == Format_A32) {
|
|
||||||
- if (subpixelType == QFontEngineFT::Subpixel_RGB || subpixelType == QFontEngineFT::Subpixel_BGR) {
|
|
||||||
+ if (subpixelType == Subpixel_RGB || subpixelType == Subpixel_BGR) {
|
|
||||||
if (default_hint_style == HintFull)
|
|
||||||
load_target = FT_LOAD_TARGET_LCD;
|
|
||||||
hsubpixel = true;
|
|
||||||
- } else if (subpixelType == QFontEngineFT::Subpixel_VRGB || subpixelType == QFontEngineFT::Subpixel_VBGR) {
|
|
||||||
+ } else if (subpixelType == Subpixel_VRGB || subpixelType == Subpixel_VBGR) {
|
|
||||||
if (default_hint_style == HintFull)
|
|
||||||
load_target = FT_LOAD_TARGET_LCD_V;
|
|
||||||
vfactor = 3;
|
|
||||||
@@ -977,9 +977,9 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
|
|
||||||
glyph_buffer = new uchar[glyph_buffer_size];
|
|
||||||
|
|
||||||
if (hsubpixel)
|
|
||||||
- convertRGBToARGB(slot->bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, slot->bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_RGB, false);
|
|
||||||
+ convertRGBToARGB(slot->bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, slot->bitmap.pitch, subpixelType != Subpixel_RGB, false);
|
|
||||||
else if (vfactor != 1)
|
|
||||||
- convertRGBToARGB_V(slot->bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, slot->bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_VRGB, false);
|
|
||||||
+ convertRGBToARGB_V(slot->bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, slot->bitmap.pitch, subpixelType != Subpixel_VRGB, false);
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
@@ -1091,10 +1091,10 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
|
|
||||||
convoluteBitmap(bitmap.buffer, convoluted, bitmap.width, info.height, bitmap.pitch);
|
|
||||||
buffer = convoluted;
|
|
||||||
}
|
|
||||||
- convertRGBToARGB(buffer + 1, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_RGB, useLegacyLcdFilter);
|
|
||||||
+ convertRGBToARGB(buffer + 1, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != Subpixel_RGB, useLegacyLcdFilter);
|
|
||||||
delete [] convoluted;
|
|
||||||
} else if (vfactor != 1) {
|
|
||||||
- convertRGBToARGB_V(bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_VRGB, true);
|
|
||||||
+ convertRGBToARGB_V(bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != Subpixel_VRGB, true);
|
|
||||||
} else if (format == Format_A32 && bitmap.pixel_mode == FT_PIXEL_MODE_GRAY) {
|
|
||||||
convertGRAYToARGB(bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch);
|
|
||||||
}
|
|
||||||
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
|
|
||||||
index 8bdf991..ba603b9 100644
|
|
||||||
--- a/src/gui/text/qfontengine_ft_p.h
|
|
||||||
+++ b/src/gui/text/qfontengine_ft_p.h
|
|
||||||
@@ -150,14 +150,6 @@ public:
|
|
||||||
uchar *data;
|
|
||||||
};
|
|
||||||
|
|
||||||
- enum SubpixelAntialiasingType {
|
|
||||||
- Subpixel_None,
|
|
||||||
- Subpixel_RGB,
|
|
||||||
- Subpixel_BGR,
|
|
||||||
- Subpixel_VRGB,
|
|
||||||
- Subpixel_VBGR
|
|
||||||
- };
|
|
||||||
-
|
|
||||||
struct GlyphInfo {
|
|
||||||
unsigned short width;
|
|
||||||
unsigned short height;
|
|
||||||
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
|
|
||||||
index fc849d7..fdd4785 100644
|
|
||||||
--- a/src/gui/text/qfontengine_p.h
|
|
||||||
+++ b/src/gui/text/qfontengine_p.h
|
|
||||||
@@ -261,6 +261,14 @@ public:
|
|
||||||
};
|
|
||||||
virtual void setDefaultHintStyle(HintStyle) { }
|
|
||||||
|
|
||||||
+ enum SubpixelAntialiasingType {
|
|
||||||
+ Subpixel_None,
|
|
||||||
+ Subpixel_RGB,
|
|
||||||
+ Subpixel_BGR,
|
|
||||||
+ Subpixel_VRGB,
|
|
||||||
+ Subpixel_VBGR
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
private:
|
|
||||||
const Type m_type;
|
|
||||||
|
|
||||||
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
|
|
||||||
index e10e10b..d95bcb9 100644
|
|
||||||
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
|
|
||||||
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
|
|
||||||
@@ -517,15 +517,15 @@ QFontEngineMulti *QFontconfigDatabase::fontEngineMulti(QFontEngine *fontEngine,
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
-QFontEngineFT::HintStyle defaultHintStyleFromMatch(QFont::HintingPreference hintingPreference, FcPattern *match)
|
|
||||||
+QFontEngine::HintStyle defaultHintStyleFromMatch(QFont::HintingPreference hintingPreference, FcPattern *match)
|
|
||||||
{
|
|
||||||
switch (hintingPreference) {
|
|
||||||
case QFont::PreferNoHinting:
|
|
||||||
- return QFontEngineFT::HintNone;
|
|
||||||
+ return QFontEngine::HintNone;
|
|
||||||
case QFont::PreferVerticalHinting:
|
|
||||||
- return QFontEngineFT::HintLight;
|
|
||||||
+ return QFontEngine::HintLight;
|
|
||||||
case QFont::PreferFullHinting:
|
|
||||||
- return QFontEngineFT::HintFull;
|
|
||||||
+ return QFontEngine::HintFull;
|
|
||||||
case QFont::PreferDefaultHinting:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
@@ -545,21 +545,21 @@ QFontEngineFT::HintStyle defaultHintStyleFromMatch(QFont::HintingPreference hint
|
|
||||||
hint_style = FC_HINT_FULL;
|
|
||||||
switch (hint_style) {
|
|
||||||
case FC_HINT_NONE:
|
|
||||||
- return QFontEngineFT::HintNone;
|
|
||||||
+ return QFontEngine::HintNone;
|
|
||||||
case FC_HINT_SLIGHT:
|
|
||||||
- return QFontEngineFT::HintLight;
|
|
||||||
+ return QFontEngine::HintLight;
|
|
||||||
case FC_HINT_MEDIUM:
|
|
||||||
- return QFontEngineFT::HintMedium;
|
|
||||||
+ return QFontEngine::HintMedium;
|
|
||||||
case FC_HINT_FULL:
|
|
||||||
- return QFontEngineFT::HintFull;
|
|
||||||
+ return QFontEngine::HintFull;
|
|
||||||
default:
|
|
||||||
Q_UNREACHABLE();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
- return QFontEngineFT::HintFull;
|
|
||||||
+ return QFontEngine::HintFull;
|
|
||||||
}
|
|
||||||
|
|
||||||
-QFontEngineFT::SubpixelAntialiasingType subpixelTypeFromMatch(FcPattern *match)
|
|
||||||
+QFontEngine::SubpixelAntialiasingType subpixelTypeFromMatch(FcPattern *match)
|
|
||||||
{
|
|
||||||
int subpixel = FC_RGBA_UNKNOWN;
|
|
||||||
FcPatternGetInteger(match, FC_RGBA, 0, &subpixel);
|
|
||||||
@@ -567,20 +567,20 @@ QFontEngineFT::SubpixelAntialiasingType subpixelTypeFromMatch(FcPattern *match)
|
|
||||||
switch (subpixel) {
|
|
||||||
case FC_RGBA_UNKNOWN:
|
|
||||||
case FC_RGBA_NONE:
|
|
||||||
- return QFontEngineFT::Subpixel_None;
|
|
||||||
+ return QFontEngine::Subpixel_None;
|
|
||||||
case FC_RGBA_RGB:
|
|
||||||
- return QFontEngineFT::Subpixel_RGB;
|
|
||||||
+ return QFontEngine::Subpixel_RGB;
|
|
||||||
case FC_RGBA_BGR:
|
|
||||||
- return QFontEngineFT::Subpixel_BGR;
|
|
||||||
+ return QFontEngine::Subpixel_BGR;
|
|
||||||
case FC_RGBA_VRGB:
|
|
||||||
- return QFontEngineFT::Subpixel_VRGB;
|
|
||||||
+ return QFontEngine::Subpixel_VRGB;
|
|
||||||
case FC_RGBA_VBGR:
|
|
||||||
- return QFontEngineFT::Subpixel_VBGR;
|
|
||||||
+ return QFontEngine::Subpixel_VBGR;
|
|
||||||
default:
|
|
||||||
Q_UNREACHABLE();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
- return QFontEngineFT::Subpixel_None;
|
|
||||||
+ return QFontEngine::Subpixel_None;
|
|
||||||
}
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
@@ -599,7 +599,7 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFontDef &f, void *usrPtr)
|
|
||||||
bool antialias = !(fontDef.styleStrategy & QFont::NoAntialias);
|
|
||||||
engine = new QFontEngineFT(fontDef);
|
|
||||||
|
|
||||||
- QFontEngineFT::GlyphFormat format;
|
|
||||||
+ QFontEngine::GlyphFormat format;
|
|
||||||
// try and get the pattern
|
|
||||||
FcPattern *pattern = FcPatternCreate();
|
|
||||||
|
|
||||||
@@ -634,20 +634,20 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFontDef &f, void *usrPtr)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (antialias) {
|
|
||||||
- QFontEngineFT::SubpixelAntialiasingType subpixelType = QFontEngineFT::Subpixel_None;
|
|
||||||
+ QFontEngine::SubpixelAntialiasingType subpixelType = QFontEngine::Subpixel_None;
|
|
||||||
if (!(f.styleStrategy & QFont::NoSubpixelAntialias))
|
|
||||||
subpixelType = subpixelTypeFromMatch(match);
|
|
||||||
engine->subpixelType = subpixelType;
|
|
||||||
|
|
||||||
- format = (subpixelType == QFontEngineFT::Subpixel_None)
|
|
||||||
- ? QFontEngineFT::Format_A8
|
|
||||||
- : QFontEngineFT::Format_A32;
|
|
||||||
+ format = (subpixelType == QFontEngine::Subpixel_None)
|
|
||||||
+ ? QFontEngine::Format_A8
|
|
||||||
+ : QFontEngine::Format_A32;
|
|
||||||
} else
|
|
||||||
- format = QFontEngineFT::Format_Mono;
|
|
||||||
+ format = QFontEngine::Format_Mono;
|
|
||||||
|
|
||||||
FcPatternDestroy(match);
|
|
||||||
} else
|
|
||||||
- format = antialias ? QFontEngineFT::Format_A8 : QFontEngineFT::Format_Mono;
|
|
||||||
+ format = antialias ? QFontEngine::Format_A8 : QFontEngine::Format_Mono;
|
|
||||||
|
|
||||||
FcPatternDestroy(pattern);
|
|
||||||
|
|
||||||
@@ -667,7 +667,7 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QByteArray &fontData, qreal p
|
|
||||||
|
|
||||||
QFontDef fontDef = engine->fontDef;
|
|
||||||
|
|
||||||
- QFontEngineFT::GlyphFormat format;
|
|
||||||
+ QFontEngine::GlyphFormat format;
|
|
||||||
// try and get the pattern
|
|
||||||
FcPattern *pattern = FcPatternCreate();
|
|
||||||
|
|
||||||
@@ -692,17 +692,17 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QByteArray &fontData, qreal p
|
|
||||||
engine->antialias = fc_antialias;
|
|
||||||
|
|
||||||
if (engine->antialias) {
|
|
||||||
- QFontEngineFT::SubpixelAntialiasingType subpixelType = subpixelTypeFromMatch(match);
|
|
||||||
+ QFontEngine::SubpixelAntialiasingType subpixelType = subpixelTypeFromMatch(match);
|
|
||||||
engine->subpixelType = subpixelType;
|
|
||||||
|
|
||||||
- format = subpixelType == QFontEngineFT::Subpixel_None
|
|
||||||
- ? QFontEngineFT::Format_A8
|
|
||||||
- : QFontEngineFT::Format_A32;
|
|
||||||
+ format = subpixelType == QFontEngine::Subpixel_None
|
|
||||||
+ ? QFontEngine::Format_A8
|
|
||||||
+ : QFontEngine::Format_A32;
|
|
||||||
} else
|
|
||||||
- format = QFontEngineFT::Format_Mono;
|
|
||||||
+ format = QFontEngine::Format_Mono;
|
|
||||||
FcPatternDestroy(match);
|
|
||||||
} else
|
|
||||||
- format = QFontEngineFT::Format_A8;
|
|
||||||
+ format = QFontEngine::Format_A8;
|
|
||||||
|
|
||||||
FcPatternDestroy(pattern);
|
|
||||||
|
|
||||||
--
|
|
||||||
2.1.1
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
|||||||
From 18bb76b3b27edf8d980e414bc2b91c44ad80aab2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: David Faure <david.faure@kdab.com>
|
|
||||||
Date: Wed, 9 Jul 2014 15:03:35 +0200
|
|
||||||
Subject: [PATCH 2/4] QUrl: fromLocalFile(QString()) should lead to an empty
|
|
||||||
URL.
|
|
||||||
|
|
||||||
This is much more useful than the URL "file:", it allows to use
|
|
||||||
"empty path" and "empty URL" for the same meaning (e.g. not set).
|
|
||||||
|
|
||||||
QFileDialog actually uses "file:" though, as the URL for the
|
|
||||||
"My Computer" item in the sidebar. This patch preserves that.
|
|
||||||
|
|
||||||
[ChangeLog][QtCore][QUrl] QUrl::fromLocalFile now returns an empty URL
|
|
||||||
if the input string is empty.
|
|
||||||
|
|
||||||
Change-Id: Ib5ce1a3cdf5f229368e5bcd83c62c1d1ac9f8a17
|
|
||||||
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
||||||
(cherry picked from commit fd331a5b3a122393cd697a8b856dd52cfd31d698)
|
|
||||||
---
|
|
||||||
src/corelib/io/qurl.cpp | 4 ++++
|
|
||||||
src/widgets/dialogs/qfiledialog.cpp | 4 ++--
|
|
||||||
src/widgets/dialogs/qsidebar.cpp | 3 ++-
|
|
||||||
tests/auto/corelib/io/qurl/tst_qurl.cpp | 5 +++++
|
|
||||||
4 files changed, 13 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
|
|
||||||
index c109fc4..00ffc4f 100644
|
|
||||||
--- a/src/corelib/io/qurl.cpp
|
|
||||||
+++ b/src/corelib/io/qurl.cpp
|
|
||||||
@@ -3714,11 +3714,15 @@ bool QUrl::isDetached() const
|
|
||||||
"//servername/path/to/file.txt". Note that only certain platforms can
|
|
||||||
actually open this file using QFile::open().
|
|
||||||
|
|
||||||
+ An empty \a localFile leads to an empty URL (since Qt 5.4).
|
|
||||||
+
|
|
||||||
\sa toLocalFile(), isLocalFile(), QDir::toNativeSeparators()
|
|
||||||
*/
|
|
||||||
QUrl QUrl::fromLocalFile(const QString &localFile)
|
|
||||||
{
|
|
||||||
QUrl url;
|
|
||||||
+ if (localFile.isEmpty())
|
|
||||||
+ return url;
|
|
||||||
url.setScheme(fileScheme());
|
|
||||||
QString deslashified = QDir::fromNativeSeparators(localFile);
|
|
||||||
|
|
||||||
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
|
|
||||||
index 037964b..82a4a4c 100644
|
|
||||||
--- a/src/widgets/dialogs/qfiledialog.cpp
|
|
||||||
+++ b/src/widgets/dialogs/qfiledialog.cpp
|
|
||||||
@@ -2783,7 +2783,7 @@ void QFileDialogPrivate::createWidgets()
|
|
||||||
qFileDialogUi->setupUi(q);
|
|
||||||
|
|
||||||
QList<QUrl> initialBookmarks;
|
|
||||||
- initialBookmarks << QUrl::fromLocalFile(QLatin1String(""))
|
|
||||||
+ initialBookmarks << QUrl(QLatin1String("file:"))
|
|
||||||
<< QUrl::fromLocalFile(QDir::homePath());
|
|
||||||
qFileDialogUi->sidebar->setModelAndUrls(model, initialBookmarks);
|
|
||||||
QFileDialog::connect(qFileDialogUi->sidebar, SIGNAL(goToUrl(QUrl)),
|
|
||||||
@@ -3760,7 +3760,7 @@ void QFileDialogComboBox::showPopup()
|
|
||||||
idx = idx.parent();
|
|
||||||
}
|
|
||||||
// add "my computer"
|
|
||||||
- list.append(QUrl::fromLocalFile(QLatin1String("")));
|
|
||||||
+ list.append(QUrl(QLatin1String("file:")));
|
|
||||||
urlModel->addUrls(list, 0);
|
|
||||||
idx = model()->index(model()->rowCount() - 1, 0);
|
|
||||||
|
|
||||||
diff --git a/src/widgets/dialogs/qsidebar.cpp b/src/widgets/dialogs/qsidebar.cpp
|
|
||||||
index 3d22992..7b691dc 100644
|
|
||||||
--- a/src/widgets/dialogs/qsidebar.cpp
|
|
||||||
+++ b/src/widgets/dialogs/qsidebar.cpp
|
|
||||||
@@ -249,7 +249,8 @@ void QUrlModel::addUrls(const QList<QUrl> &list, int row, bool move)
|
|
||||||
continue;
|
|
||||||
//this makes sure the url is clean
|
|
||||||
const QString cleanUrl = QDir::cleanPath(url.toLocalFile());
|
|
||||||
- url = QUrl::fromLocalFile(cleanUrl);
|
|
||||||
+ if (!cleanUrl.isEmpty())
|
|
||||||
+ url = QUrl::fromLocalFile(cleanUrl);
|
|
||||||
|
|
||||||
for (int j = 0; move && j < rowCount(); ++j) {
|
|
||||||
QString local = index(j, 0).data(UrlRole).toUrl().toLocalFile();
|
|
||||||
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
|
|
||||||
index d5eab54..b8bab87 100644
|
|
||||||
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
|
|
||||||
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
|
|
||||||
@@ -235,6 +235,11 @@ void tst_QUrl::constructing()
|
|
||||||
QVERIFY(url == url);
|
|
||||||
QVERIFY(!(url < url));
|
|
||||||
|
|
||||||
+ QUrl fromLocal = QUrl::fromLocalFile(QString());
|
|
||||||
+ QVERIFY(!fromLocal.isValid());
|
|
||||||
+ QVERIFY(fromLocal.isEmpty());
|
|
||||||
+ QCOMPARE(fromLocal.toString(), QString());
|
|
||||||
+
|
|
||||||
QUrl justHost("qt-project.org");
|
|
||||||
QVERIFY(!justHost.isEmpty());
|
|
||||||
QVERIFY(justHost.host().isEmpty());
|
|
||||||
--
|
|
||||||
2.1.1
|
|
||||||
|
|
@ -1,188 +0,0 @@
|
|||||||
From a006c934177263675302cd5f4ae0c3b1e35215e3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thiago Macieira <thiago.macieira@intel.com>
|
|
||||||
Date: Tue, 28 Oct 2014 19:26:17 -0700
|
|
||||||
Subject: [PATCH 3/4] QDBusConnection: Merge the dispatch and the
|
|
||||||
watch-and-timeout locks
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
We don't need two anymore because they now protect the same thing: the
|
|
||||||
state of the DBusConnection. The difference existed when it was possible
|
|
||||||
for two threads to access the DBusConnection at the same time: one doing
|
|
||||||
dispatching and one doing something else. Unfortunately, even though
|
|
||||||
DBusConnection supports this, QtDBus doesn't.
|
|
||||||
|
|
||||||
From d47c05b1889bb4f06203bbc65f4660b8d0128954 (2008-10-08):
|
|
||||||
Details: if we're removing a timer or a watcher from our list,
|
|
||||||
there's a race condition: one thread (not the QDBusConnection thread)
|
|
||||||
could be asking for the removal (which causes an event to be sent),
|
|
||||||
then deletes the pointer. In the meantime, QDBusConnection will
|
|
||||||
process the timers and socket notifiers and could end up calling
|
|
||||||
lidbus-1 with deleted pointers.
|
|
||||||
|
|
||||||
That commit fixed the race condition but introduced a deadlock.
|
|
||||||
|
|
||||||
Task-number: QTBUG-42189
|
|
||||||
Change-Id: I034038f763cbad3a67398909defd31a23c27c965
|
|
||||||
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
|
|
||||||
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
|
|
||||||
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
|
|
||||||
(cherry picked from commit eb99c28861f5e841f306cfe8689627fe0e9bf2e8)
|
|
||||||
---
|
|
||||||
src/dbus/qdbusconnection_p.h | 16 +++++-----------
|
|
||||||
src/dbus/qdbusintegrator.cpp | 22 +++++++++++-----------
|
|
||||||
src/dbus/qdbusthreaddebug_p.h | 7 -------
|
|
||||||
3 files changed, 16 insertions(+), 29 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
|
|
||||||
index fd4ced078d667d966920728252d5ee55dda76ec1..a75dabeeee5c2b920fc4708f2eeefdaeb97ba32c 100644
|
|
||||||
--- a/src/dbus/qdbusconnection_p.h
|
|
||||||
+++ b/src/dbus/qdbusconnection_p.h
|
|
||||||
@@ -290,24 +290,18 @@ public:
|
|
||||||
QStringList serverConnectionNames;
|
|
||||||
|
|
||||||
ConnectionMode mode;
|
|
||||||
+ QDBusConnectionInterface *busService;
|
|
||||||
|
|
||||||
- // members accessed in unlocked mode (except for deletion)
|
|
||||||
- // connection and server provide their own locking mechanisms
|
|
||||||
- // busService doesn't have state to be changed
|
|
||||||
+ // the dispatch lock protects everything related to the DBusConnection or DBusServer
|
|
||||||
+ // including the timeouts and watches
|
|
||||||
+ QMutex dispatchLock;
|
|
||||||
DBusConnection *connection;
|
|
||||||
DBusServer *server;
|
|
||||||
- QDBusConnectionInterface *busService;
|
|
||||||
-
|
|
||||||
- // watchers and timeouts are accessed from any thread
|
|
||||||
- // but the corresponding timer and QSocketNotifier must be handled
|
|
||||||
- // only in the object's thread
|
|
||||||
- QMutex watchAndTimeoutLock;
|
|
||||||
WatcherHash watchers;
|
|
||||||
TimeoutHash timeouts;
|
|
||||||
PendingTimeoutList timeoutsPendingAdd;
|
|
||||||
|
|
||||||
- // members accessed through a lock
|
|
||||||
- QMutex dispatchLock;
|
|
||||||
+ // the master lock protects our own internal state
|
|
||||||
QReadWriteLock lock;
|
|
||||||
QDBusError lastError;
|
|
||||||
|
|
||||||
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
|
|
||||||
index 03f9eef96ed160b8b6df888661d5c1bd5840047b..b396c23a1d0c1958971ce76c8b93ab43c9a18c68 100644
|
|
||||||
--- a/src/dbus/qdbusintegrator.cpp
|
|
||||||
+++ b/src/dbus/qdbusintegrator.cpp
|
|
||||||
@@ -161,7 +161,7 @@ static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data)
|
|
||||||
if (!q_dbus_timeout_get_enabled(timeout))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
- QDBusWatchAndTimeoutLocker locker(AddTimeoutAction, d);
|
|
||||||
+ QDBusDispatchLocker locker(AddTimeoutAction, d);
|
|
||||||
if (QCoreApplication::instance() && QThread::currentThread() == d->thread()) {
|
|
||||||
// correct thread
|
|
||||||
return qDBusRealAddTimeout(d, timeout, q_dbus_timeout_get_interval(timeout));
|
|
||||||
@@ -196,7 +196,7 @@ static void qDBusRemoveTimeout(DBusTimeout *timeout, void *data)
|
|
||||||
|
|
||||||
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
|
|
||||||
|
|
||||||
- QDBusWatchAndTimeoutLocker locker(RemoveTimeoutAction, d);
|
|
||||||
+ QDBusDispatchLocker locker(RemoveTimeoutAction, d);
|
|
||||||
|
|
||||||
// is it pending addition?
|
|
||||||
QDBusConnectionPrivate::PendingTimeoutList::iterator pit = d->timeoutsPendingAdd.begin();
|
|
||||||
@@ -269,7 +269,7 @@ static bool qDBusRealAddWatch(QDBusConnectionPrivate *d, DBusWatch *watch, int f
|
|
||||||
{
|
|
||||||
QDBusConnectionPrivate::Watcher watcher;
|
|
||||||
|
|
||||||
- QDBusWatchAndTimeoutLocker locker(AddWatchAction, d);
|
|
||||||
+ QDBusDispatchLocker locker(AddWatchAction, d);
|
|
||||||
if (flags & DBUS_WATCH_READABLE) {
|
|
||||||
//qDebug("addReadWatch %d", fd);
|
|
||||||
watcher.watch = watch;
|
|
||||||
@@ -303,7 +303,7 @@ static void qDBusRemoveWatch(DBusWatch *watch, void *data)
|
|
||||||
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
|
|
||||||
int fd = q_dbus_watch_get_unix_fd(watch);
|
|
||||||
|
|
||||||
- QDBusWatchAndTimeoutLocker locker(RemoveWatchAction, d);
|
|
||||||
+ QDBusDispatchLocker locker(RemoveWatchAction, d);
|
|
||||||
QDBusConnectionPrivate::WatcherHash::iterator i = d->watchers.find(fd);
|
|
||||||
while (i != d->watchers.end() && i.key() == fd) {
|
|
||||||
if (i.value().watch == watch) {
|
|
||||||
@@ -347,7 +347,7 @@ static void qDBusToggleWatch(DBusWatch *watch, void *data)
|
|
||||||
|
|
||||||
static void qDBusRealToggleWatch(QDBusConnectionPrivate *d, DBusWatch *watch, int fd)
|
|
||||||
{
|
|
||||||
- QDBusWatchAndTimeoutLocker locker(ToggleWatchAction, d);
|
|
||||||
+ QDBusDispatchLocker locker(ToggleWatchAction, d);
|
|
||||||
|
|
||||||
QDBusConnectionPrivate::WatcherHash::iterator i = d->watchers.find(fd);
|
|
||||||
while (i != d->watchers.end() && i.key() == fd) {
|
|
||||||
@@ -1022,8 +1022,8 @@ void QDBusConnectionPrivate::deliverCall(QObject *object, int /*flags*/, const Q
|
|
||||||
extern bool qDBusInitThreads();
|
|
||||||
|
|
||||||
QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
|
|
||||||
- : QObject(p), ref(1), capabilities(0), mode(InvalidMode), connection(0), server(0), busService(0),
|
|
||||||
- watchAndTimeoutLock(QMutex::Recursive), dispatchLock(QMutex::Recursive),
|
|
||||||
+ : QObject(p), ref(1), capabilities(0), mode(InvalidMode), busService(0),
|
|
||||||
+ dispatchLock(QMutex::Recursive), connection(0), server(0),
|
|
||||||
rootNode(QString(QLatin1Char('/'))),
|
|
||||||
anonymousAuthenticationAllowed(false)
|
|
||||||
{
|
|
||||||
@@ -1133,7 +1133,7 @@ bool QDBusConnectionPrivate::handleError(const QDBusErrorInternal &error)
|
|
||||||
void QDBusConnectionPrivate::timerEvent(QTimerEvent *e)
|
|
||||||
{
|
|
||||||
{
|
|
||||||
- QDBusWatchAndTimeoutLocker locker(TimerEventAction, this);
|
|
||||||
+ QDBusDispatchLocker locker(TimerEventAction, this);
|
|
||||||
DBusTimeout *timeout = timeouts.value(e->timerId(), 0);
|
|
||||||
if (timeout)
|
|
||||||
q_dbus_timeout_handle(timeout);
|
|
||||||
@@ -1152,7 +1152,7 @@ void QDBusConnectionPrivate::customEvent(QEvent *e)
|
|
||||||
switch (ev->subtype)
|
|
||||||
{
|
|
||||||
case QDBusConnectionCallbackEvent::AddTimeout: {
|
|
||||||
- QDBusWatchAndTimeoutLocker locker(RealAddTimeoutAction, this);
|
|
||||||
+ QDBusDispatchLocker locker(RealAddTimeoutAction, this);
|
|
||||||
while (!timeoutsPendingAdd.isEmpty()) {
|
|
||||||
QPair<DBusTimeout *, int> entry = timeoutsPendingAdd.takeFirst();
|
|
||||||
qDBusRealAddTimeout(this, entry.first, entry.second);
|
|
||||||
@@ -1188,7 +1188,7 @@ void QDBusConnectionPrivate::socketRead(int fd)
|
|
||||||
QVarLengthArray<DBusWatch *, 2> pendingWatches;
|
|
||||||
|
|
||||||
{
|
|
||||||
- QDBusWatchAndTimeoutLocker locker(SocketReadAction, this);
|
|
||||||
+ QDBusDispatchLocker locker(SocketReadAction, this);
|
|
||||||
WatcherHash::ConstIterator it = watchers.constFind(fd);
|
|
||||||
while (it != watchers.constEnd() && it.key() == fd) {
|
|
||||||
if (it->watch && it->read && it->read->isEnabled())
|
|
||||||
@@ -1208,7 +1208,7 @@ void QDBusConnectionPrivate::socketWrite(int fd)
|
|
||||||
QVarLengthArray<DBusWatch *, 2> pendingWatches;
|
|
||||||
|
|
||||||
{
|
|
||||||
- QDBusWatchAndTimeoutLocker locker(SocketWriteAction, this);
|
|
||||||
+ QDBusDispatchLocker locker(SocketWriteAction, this);
|
|
||||||
WatcherHash::ConstIterator it = watchers.constFind(fd);
|
|
||||||
while (it != watchers.constEnd() && it.key() == fd) {
|
|
||||||
if (it->watch && it->write && it->write->isEnabled())
|
|
||||||
diff --git a/src/dbus/qdbusthreaddebug_p.h b/src/dbus/qdbusthreaddebug_p.h
|
|
||||||
index dcde99169cc15424c7cfa0acf3fd18272ef12aca..726ab051d0739ece9d1ea623e04b39f9368464ec 100644
|
|
||||||
--- a/src/dbus/qdbusthreaddebug_p.h
|
|
||||||
+++ b/src/dbus/qdbusthreaddebug_p.h
|
|
||||||
@@ -207,13 +207,6 @@ struct QDBusDispatchLocker: QDBusMutexLocker
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
|
|
||||||
-struct QDBusWatchAndTimeoutLocker: QDBusMutexLocker
|
|
||||||
-{
|
|
||||||
- inline QDBusWatchAndTimeoutLocker(ThreadAction a, QDBusConnectionPrivate *s)
|
|
||||||
- : QDBusMutexLocker(a, s, &s->watchAndTimeoutLock)
|
|
||||||
- { }
|
|
||||||
-};
|
|
||||||
-
|
|
||||||
#if QDBUS_THREAD_DEBUG
|
|
||||||
# define SEM_ACQUIRE(action, sem) \
|
|
||||||
do { \
|
|
||||||
--
|
|
||||||
2.1.2
|
|
||||||
|
|
@ -1,315 +0,0 @@
|
|||||||
From c738b6f8a3d4b76fcd19be9d046e903eabc3301c Mon Sep 17 00:00:00 2001
|
|
||||||
From: David Faure <david.faure@kdab.com>
|
|
||||||
Date: Wed, 9 Jul 2014 11:54:36 +0200
|
|
||||||
Subject: [PATCH 3/4] QFileDialog: turn workingDirectory into a QUrl
|
|
||||||
|
|
||||||
In order to make this work better with remote URLs.
|
|
||||||
|
|
||||||
Change-Id: Ic440735142441150838b05e88940adcc12a90d09
|
|
||||||
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
|
|
||||||
(cherry picked from commit cd3331802516c012aed1be329e2e889478cbdd3e)
|
|
||||||
---
|
|
||||||
src/widgets/dialogs/qfiledialog.cpp | 106 +++++++++++++++++++++---------------
|
|
||||||
src/widgets/dialogs/qfiledialog_p.h | 10 ++--
|
|
||||||
2 files changed, 68 insertions(+), 48 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
|
|
||||||
index 82a4a4c..ab0361a 100644
|
|
||||||
--- a/src/widgets/dialogs/qfiledialog.cpp
|
|
||||||
+++ b/src/widgets/dialogs/qfiledialog.cpp
|
|
||||||
@@ -78,7 +78,7 @@ extern bool qt_priv_ptr_valid;
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
-Q_GLOBAL_STATIC(QString, lastVisitedDir)
|
|
||||||
+Q_GLOBAL_STATIC(QUrl, lastVisitedDir)
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\class QFileDialog
|
|
||||||
@@ -373,7 +373,7 @@ QFileDialog::QFileDialog(QWidget *parent,
|
|
||||||
: QDialog(*new QFileDialogPrivate, parent, 0)
|
|
||||||
{
|
|
||||||
Q_D(QFileDialog);
|
|
||||||
- d->init(directory, filter, caption);
|
|
||||||
+ d->init(QUrl::fromLocalFile(directory), filter, caption);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@@ -444,7 +444,7 @@ static const qint32 QFileDialogMagic = 0xbe;
|
|
||||||
QByteArray QFileDialog::saveState() const
|
|
||||||
{
|
|
||||||
Q_D(const QFileDialog);
|
|
||||||
- int version = 3;
|
|
||||||
+ int version = 4;
|
|
||||||
QByteArray data;
|
|
||||||
QDataStream stream(&data, QIODevice::WriteOnly);
|
|
||||||
|
|
||||||
@@ -479,7 +479,6 @@ QByteArray QFileDialog::saveState() const
|
|
||||||
bool QFileDialog::restoreState(const QByteArray &state)
|
|
||||||
{
|
|
||||||
Q_D(QFileDialog);
|
|
||||||
- int version = 3;
|
|
||||||
QByteArray sd = state;
|
|
||||||
QDataStream stream(&sd, QIODevice::ReadOnly);
|
|
||||||
if (stream.atEnd())
|
|
||||||
@@ -488,23 +487,30 @@ bool QFileDialog::restoreState(const QByteArray &state)
|
|
||||||
QByteArray headerData;
|
|
||||||
QList<QUrl> bookmarks;
|
|
||||||
QStringList history;
|
|
||||||
- QString currentDirectory;
|
|
||||||
+ QUrl currentDirectory;
|
|
||||||
qint32 marker;
|
|
||||||
qint32 v;
|
|
||||||
qint32 viewMode;
|
|
||||||
stream >> marker;
|
|
||||||
stream >> v;
|
|
||||||
- if (marker != QFileDialogMagic || v != version)
|
|
||||||
+ // the code below only supports versions 3 and 4
|
|
||||||
+ if (marker != QFileDialogMagic || (v != 3 && v != 4))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
stream >> splitterState
|
|
||||||
>> bookmarks
|
|
||||||
- >> history
|
|
||||||
- >> currentDirectory
|
|
||||||
- >> headerData
|
|
||||||
+ >> history;
|
|
||||||
+ if (v == 3) {
|
|
||||||
+ QString currentDirectoryString;
|
|
||||||
+ stream >> currentDirectoryString;
|
|
||||||
+ currentDirectory = QUrl::fromLocalFile(currentDirectoryString);
|
|
||||||
+ } else {
|
|
||||||
+ stream >> currentDirectory;
|
|
||||||
+ }
|
|
||||||
+ stream >> headerData
|
|
||||||
>> viewMode;
|
|
||||||
|
|
||||||
- setDirectory(lastVisitedDir()->isEmpty() ? currentDirectory : *lastVisitedDir());
|
|
||||||
+ setDirectoryUrl(lastVisitedDir()->isEmpty() ? currentDirectory : *lastVisitedDir());
|
|
||||||
setViewMode(static_cast<QFileDialog::ViewMode>(viewMode));
|
|
||||||
|
|
||||||
if (!d->usingWidgets())
|
|
||||||
@@ -630,7 +636,7 @@ void QFileDialogPrivate::retranslateWindowTitle()
|
|
||||||
setWindowTitle = q->windowTitle();
|
|
||||||
}
|
|
||||||
|
|
||||||
-void QFileDialogPrivate::setLastVisitedDirectory(const QString &dir)
|
|
||||||
+void QFileDialogPrivate::setLastVisitedDirectory(const QUrl &dir)
|
|
||||||
{
|
|
||||||
*lastVisitedDir() = dir;
|
|
||||||
}
|
|
||||||
@@ -944,11 +950,12 @@ void QFileDialog::setDirectory(const QString &directory)
|
|
||||||
if (!directory.isEmpty() && newDirectory.isEmpty())
|
|
||||||
return;
|
|
||||||
|
|
||||||
- d->setLastVisitedDirectory(newDirectory);
|
|
||||||
+ QUrl newDirUrl = QUrl::fromLocalFile(newDirectory);
|
|
||||||
+ d->setLastVisitedDirectory(newDirUrl);
|
|
||||||
|
|
||||||
d->options->setInitialDirectory(QUrl::fromLocalFile(directory));
|
|
||||||
if (!d->usingWidgets()) {
|
|
||||||
- d->setDirectory_sys(QUrl::fromLocalFile(newDirectory));
|
|
||||||
+ d->setDirectory_sys(newDirUrl);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (d->rootPath() == newDirectory)
|
|
||||||
@@ -995,6 +1002,9 @@ void QFileDialog::setDirectoryUrl(const QUrl &directory)
|
|
||||||
if (!directory.isValid())
|
|
||||||
return;
|
|
||||||
|
|
||||||
+ d->setLastVisitedDirectory(directory);
|
|
||||||
+ d->options->setInitialDirectory(directory);
|
|
||||||
+
|
|
||||||
if (d->nativeDialogInUse)
|
|
||||||
d->setDirectory_sys(directory);
|
|
||||||
else if (directory.isLocalFile())
|
|
||||||
@@ -2103,8 +2113,8 @@ QString QFileDialog::getOpenFileName(QWidget *parent,
|
|
||||||
QFileDialogArgs args;
|
|
||||||
args.parent = parent;
|
|
||||||
args.caption = caption;
|
|
||||||
- args.directory = QFileDialogPrivate::workingDirectory(dir);
|
|
||||||
- args.selection = QFileDialogPrivate::initialSelection(dir);
|
|
||||||
+ args.directory = QFileDialogPrivate::workingDirectory(QUrl::fromLocalFile(dir));
|
|
||||||
+ args.selection = QFileDialogPrivate::initialSelection(QUrl::fromLocalFile(dir));
|
|
||||||
args.filter = filter;
|
|
||||||
args.mode = ExistingFile;
|
|
||||||
args.options = options;
|
|
||||||
@@ -2231,8 +2241,8 @@ QStringList QFileDialog::getOpenFileNames(QWidget *parent,
|
|
||||||
QFileDialogArgs args;
|
|
||||||
args.parent = parent;
|
|
||||||
args.caption = caption;
|
|
||||||
- args.directory = QFileDialogPrivate::workingDirectory(dir);
|
|
||||||
- args.selection = QFileDialogPrivate::initialSelection(dir);
|
|
||||||
+ args.directory = QFileDialogPrivate::workingDirectory(QUrl::fromLocalFile(dir));
|
|
||||||
+ args.selection = QFileDialogPrivate::initialSelection(QUrl::fromLocalFile(dir));
|
|
||||||
args.filter = filter;
|
|
||||||
args.mode = ExistingFiles;
|
|
||||||
args.options = options;
|
|
||||||
@@ -2363,8 +2373,8 @@ QString QFileDialog::getSaveFileName(QWidget *parent,
|
|
||||||
QFileDialogArgs args;
|
|
||||||
args.parent = parent;
|
|
||||||
args.caption = caption;
|
|
||||||
- args.directory = QFileDialogPrivate::workingDirectory(dir);
|
|
||||||
- args.selection = QFileDialogPrivate::initialSelection(dir);
|
|
||||||
+ args.directory = QFileDialogPrivate::workingDirectory(QUrl::fromLocalFile(dir));
|
|
||||||
+ args.selection = QFileDialogPrivate::initialSelection(QUrl::fromLocalFile(dir));
|
|
||||||
args.filter = filter;
|
|
||||||
args.mode = AnyFile;
|
|
||||||
args.options = options;
|
|
||||||
@@ -2477,7 +2487,7 @@ QString QFileDialog::getExistingDirectory(QWidget *parent,
|
|
||||||
QFileDialogArgs args;
|
|
||||||
args.parent = parent;
|
|
||||||
args.caption = caption;
|
|
||||||
- args.directory = QFileDialogPrivate::workingDirectory(dir);
|
|
||||||
+ args.directory = QFileDialogPrivate::workingDirectory(QUrl::fromLocalFile(dir));
|
|
||||||
args.mode = (options & ShowDirsOnly ? DirectoryOnly : Directory);
|
|
||||||
args.options = options;
|
|
||||||
|
|
||||||
@@ -2538,32 +2548,36 @@ QUrl QFileDialog::getExistingDirectoryUrl(QWidget *parent,
|
|
||||||
return dialogResultToUrl(getExistingDirectory(parent, caption, dir.toLocalFile(), options));
|
|
||||||
}
|
|
||||||
|
|
||||||
-inline static QString _qt_get_directory(const QString &path)
|
|
||||||
+inline static QUrl _qt_get_directory(const QUrl &url)
|
|
||||||
{
|
|
||||||
- QFileInfo info = QFileInfo(QDir::current(), path);
|
|
||||||
- if (info.exists() && info.isDir())
|
|
||||||
- return QDir::cleanPath(info.absoluteFilePath());
|
|
||||||
- info.setFile(info.absolutePath());
|
|
||||||
- if (info.exists() && info.isDir())
|
|
||||||
- return info.absoluteFilePath();
|
|
||||||
- return QString();
|
|
||||||
+ if (url.isLocalFile()) {
|
|
||||||
+ QFileInfo info = QFileInfo(QDir::current(), url.toLocalFile());
|
|
||||||
+ if (info.exists() && info.isDir())
|
|
||||||
+ return QUrl::fromLocalFile(QDir::cleanPath(info.absoluteFilePath()));
|
|
||||||
+ info.setFile(info.absolutePath());
|
|
||||||
+ if (info.exists() && info.isDir())
|
|
||||||
+ return QUrl::fromLocalFile(info.absoluteFilePath());
|
|
||||||
+ return QUrl();
|
|
||||||
+ } else {
|
|
||||||
+ return url;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
- Get the initial directory path
|
|
||||||
+ Get the initial directory URL
|
|
||||||
|
|
||||||
\sa initialSelection()
|
|
||||||
*/
|
|
||||||
-QString QFileDialogPrivate::workingDirectory(const QString &path)
|
|
||||||
+QUrl QFileDialogPrivate::workingDirectory(const QUrl &url)
|
|
||||||
{
|
|
||||||
- if (!path.isEmpty()) {
|
|
||||||
- QString directory = _qt_get_directory(path);
|
|
||||||
+ if (!url.isEmpty()) {
|
|
||||||
+ QUrl directory = _qt_get_directory(url);
|
|
||||||
if (!directory.isEmpty())
|
|
||||||
return directory;
|
|
||||||
}
|
|
||||||
- QString directory = _qt_get_directory(*lastVisitedDir());
|
|
||||||
+ QUrl directory = _qt_get_directory(*lastVisitedDir());
|
|
||||||
if (!directory.isEmpty())
|
|
||||||
return directory;
|
|
||||||
- return QDir::currentPath();
|
|
||||||
+ return QUrl::fromLocalFile(QDir::currentPath());
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ -2573,14 +2587,19 @@ QString QFileDialogPrivate::workingDirectory(const QString &path)
|
|
||||||
|
|
||||||
\sa workingDirectory()
|
|
||||||
*/
|
|
||||||
-QString QFileDialogPrivate::initialSelection(const QString &path)
|
|
||||||
+QString QFileDialogPrivate::initialSelection(const QUrl &url)
|
|
||||||
{
|
|
||||||
- if (!path.isEmpty()) {
|
|
||||||
- QFileInfo info(path);
|
|
||||||
+ if (url.isEmpty())
|
|
||||||
+ return QString();
|
|
||||||
+ if (url.isLocalFile()) {
|
|
||||||
+ QFileInfo info(url.toLocalFile());
|
|
||||||
if (!info.isDir())
|
|
||||||
return info.fileName();
|
|
||||||
+ else
|
|
||||||
+ return QString();
|
|
||||||
}
|
|
||||||
- return QString();
|
|
||||||
+ // With remote URLs we can only assume.
|
|
||||||
+ return url.fileName();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@@ -2717,7 +2736,7 @@ void QFileDialog::accept()
|
|
||||||
|
|
||||||
Create widgets, layout and set default values
|
|
||||||
*/
|
|
||||||
-void QFileDialogPrivate::init(const QString &directory, const QString &nameFilter,
|
|
||||||
+void QFileDialogPrivate::init(const QUrl &directory, const QString &nameFilter,
|
|
||||||
const QString &caption)
|
|
||||||
{
|
|
||||||
Q_Q(QFileDialog);
|
|
||||||
@@ -2734,7 +2753,7 @@ void QFileDialogPrivate::init(const QString &directory, const QString &nameFilte
|
|
||||||
q->setFileMode(QFileDialog::AnyFile);
|
|
||||||
if (!nameFilter.isEmpty())
|
|
||||||
q->setNameFilter(nameFilter);
|
|
||||||
- q->setDirectory(workingDirectory(directory));
|
|
||||||
+ q->setDirectoryUrl(workingDirectory(directory));
|
|
||||||
q->selectFile(initialSelection(directory));
|
|
||||||
|
|
||||||
#ifndef QT_NO_SETTINGS
|
|
||||||
@@ -3683,9 +3702,10 @@ void QFileDialogPrivate::_q_nativeEnterDirectory(const QUrl &directory)
|
|
||||||
{
|
|
||||||
Q_Q(QFileDialog);
|
|
||||||
emit q->directoryUrlEntered(directory);
|
|
||||||
- if (!directory.isEmpty() && directory.isLocalFile()) { // Windows native dialogs occasionally emit signals with empty strings.
|
|
||||||
- *lastVisitedDir() = directory.toLocalFile();
|
|
||||||
- emit q->directoryEntered(directory.toLocalFile());
|
|
||||||
+ if (!directory.isEmpty()) { // Windows native dialogs occasionally emit signals with empty strings.
|
|
||||||
+ *lastVisitedDir() = directory;
|
|
||||||
+ if (directory.isLocalFile())
|
|
||||||
+ emit q->directoryEntered(directory.toLocalFile());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
|
|
||||||
index 9e1c23b..175760c 100644
|
|
||||||
--- a/src/widgets/dialogs/qfiledialog_p.h
|
|
||||||
+++ b/src/widgets/dialogs/qfiledialog_p.h
|
|
||||||
@@ -100,7 +100,7 @@ struct QFileDialogArgs
|
|
||||||
|
|
||||||
QWidget *parent;
|
|
||||||
QString caption;
|
|
||||||
- QString directory;
|
|
||||||
+ QUrl directory;
|
|
||||||
QString selection;
|
|
||||||
QString filter;
|
|
||||||
QFileDialog::FileMode mode;
|
|
||||||
@@ -123,12 +123,12 @@ public:
|
|
||||||
void createMenuActions();
|
|
||||||
void createWidgets();
|
|
||||||
|
|
||||||
- void init(const QString &directory = QString(), const QString &nameFilter = QString(),
|
|
||||||
+ void init(const QUrl &directory = QUrl(), const QString &nameFilter = QString(),
|
|
||||||
const QString &caption = QString());
|
|
||||||
bool itemViewKeyboardEvent(QKeyEvent *event);
|
|
||||||
QString getEnvironmentVariable(const QString &string);
|
|
||||||
- static QString workingDirectory(const QString &path);
|
|
||||||
- static QString initialSelection(const QString &path);
|
|
||||||
+ static QUrl workingDirectory(const QUrl &path);
|
|
||||||
+ static QString initialSelection(const QUrl &path);
|
|
||||||
QStringList typedFiles() const;
|
|
||||||
QList<QUrl> userSelectedFiles() const;
|
|
||||||
QStringList addDefaultSuffixToFiles(const QStringList filesToFix) const;
|
|
||||||
@@ -189,7 +189,7 @@ public:
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
- void setLastVisitedDirectory(const QString &dir);
|
|
||||||
+ void setLastVisitedDirectory(const QUrl &dir);
|
|
||||||
void retranslateWindowTitle();
|
|
||||||
void retranslateStrings();
|
|
||||||
void emitFilesSelected(const QStringList &files);
|
|
||||||
--
|
|
||||||
2.1.1
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
|||||||
From e5d61b2531ce2000e7e230d4cfdb793fa2b686e8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Allan Sandfeld Jensen <allan.jensen@digia.com>
|
|
||||||
Date: Mon, 11 Aug 2014 14:03:35 +0200
|
|
||||||
Subject: [PATCH 3/4] Support autohint and lcdfilter fontconfig configuration
|
|
||||||
|
|
||||||
This patch adds support for reading autohint and lcdfilter settings
|
|
||||||
from fontconfig and pass them on to freetype.
|
|
||||||
|
|
||||||
Task-number: QTBUG-32254
|
|
||||||
Change-Id: Iaa69b70f7005ee7f21126a8d984c07b3a46a3e7f
|
|
||||||
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
|
|
||||||
(cherry picked from commit b35176f43a953d56380414f05834c7918762cb83)
|
|
||||||
---
|
|
||||||
src/gui/text/qfontengine_ft.cpp | 4 ++++
|
|
||||||
src/gui/text/qfontengine_ft_p.h | 1 +
|
|
||||||
.../fontdatabases/fontconfig/qfontconfigdatabase.cpp | 20 ++++++++++++++++++++
|
|
||||||
3 files changed, 25 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
|
|
||||||
index ad4276b..eef316b 100644
|
|
||||||
--- a/src/gui/text/qfontengine_ft.cpp
|
|
||||||
+++ b/src/gui/text/qfontengine_ft.cpp
|
|
||||||
@@ -678,6 +678,7 @@ QFontEngineFT::QFontEngineFT(const QFontDef &fd)
|
|
||||||
const QByteArray env = qgetenv("QT_NO_FT_CACHE");
|
|
||||||
cacheEnabled = env.isEmpty() || env.toInt() == 0;
|
|
||||||
m_subPixelPositionCount = 4;
|
|
||||||
+ forceAutoHint = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
QFontEngineFT::~QFontEngineFT()
|
|
||||||
@@ -832,6 +833,9 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags,
|
|
||||||
else
|
|
||||||
load_flags |= load_target;
|
|
||||||
|
|
||||||
+ if (forceAutoHint)
|
|
||||||
+ load_flags |= FT_LOAD_FORCE_AUTOHINT;
|
|
||||||
+
|
|
||||||
return load_flags;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
|
|
||||||
index ba603b9..09c70c5 100644
|
|
||||||
--- a/src/gui/text/qfontengine_ft_p.h
|
|
||||||
+++ b/src/gui/text/qfontengine_ft_p.h
|
|
||||||
@@ -307,6 +307,7 @@ protected:
|
|
||||||
int lcdFilterType;
|
|
||||||
bool embeddedbitmap;
|
|
||||||
bool cacheEnabled;
|
|
||||||
+ bool forceAutoHint;
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class QFontEngineFTRawFont;
|
|
||||||
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
|
|
||||||
index d95bcb9..0bf119c 100644
|
|
||||||
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
|
|
||||||
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
|
|
||||||
@@ -625,6 +625,16 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFontDef &f, void *usrPtr)
|
|
||||||
if (match) {
|
|
||||||
engine->setDefaultHintStyle(defaultHintStyleFromMatch((QFont::HintingPreference)f.hintingPreference, match));
|
|
||||||
|
|
||||||
+ FcBool fc_autohint;
|
|
||||||
+ if (FcPatternGetBool(match, FC_AUTOHINT,0, &fc_autohint) == FcResultMatch)
|
|
||||||
+ engine->forceAutoHint = fc_autohint;
|
|
||||||
+
|
|
||||||
+#if defined(FT_LCD_FILTER_H)
|
|
||||||
+ int lcdFilter;
|
|
||||||
+ if (FcPatternGetInteger(match, FC_LCD_FILTER, 0, &lcdFilter) == FcResultMatch)
|
|
||||||
+ engine->lcdFilterType = lcdFilter;
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
if (antialias) {
|
|
||||||
// If antialiasing is not fully disabled, fontconfig may still disable it on a font match basis.
|
|
||||||
FcBool fc_antialias;
|
|
||||||
@@ -686,6 +696,16 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QByteArray &fontData, qreal p
|
|
||||||
if (match) {
|
|
||||||
engine->setDefaultHintStyle(defaultHintStyleFromMatch(hintingPreference, match));
|
|
||||||
|
|
||||||
+ FcBool fc_autohint;
|
|
||||||
+ if (FcPatternGetBool(match, FC_AUTOHINT,0, &fc_autohint) == FcResultMatch)
|
|
||||||
+ engine->forceAutoHint = fc_autohint;
|
|
||||||
+
|
|
||||||
+#if defined(FT_LCD_FILTER_H)
|
|
||||||
+ int lcdFilter;
|
|
||||||
+ if (FcPatternGetInteger(match, FC_LCD_FILTER, 0, &lcdFilter) == FcResultMatch)
|
|
||||||
+ engine->lcdFilterType = lcdFilter;
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
FcBool fc_antialias;
|
|
||||||
if (FcPatternGetBool(match, FC_ANTIALIAS,0, &fc_antialias) != FcResultMatch)
|
|
||||||
fc_antialias = true;
|
|
||||||
--
|
|
||||||
2.1.1
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
|||||||
From d7afdc53b28d107bbf8cdfd52777cb7cb9f2c10d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Allan Sandfeld Jensen <allan.jensen@digia.com>
|
|
||||||
Date: Tue, 12 Aug 2014 16:59:18 +0200
|
|
||||||
Subject: [PATCH 4/4] GTK2 theme should use GTK configured font variant
|
|
||||||
|
|
||||||
This patch makes the GTK2 theme read the font configuration and use
|
|
||||||
that as the default system font.
|
|
||||||
|
|
||||||
Task-number: QTBUG-39643
|
|
||||||
Change-Id: Ieacf8968e54f34c6d44669350d349c9a96ed6cc5
|
|
||||||
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
|
|
||||||
(cherry picked from commit 2a33bfcfd174d503e2f98c66d8de0a68783015da)
|
|
||||||
---
|
|
||||||
.../themes/genericunix/qgenericunixthemes.cpp | 27 +++++++++++++++++-----
|
|
||||||
.../themes/genericunix/qgenericunixthemes_p.h | 2 ++
|
|
||||||
src/plugins/platformthemes/gtk2/qgtk2theme.cpp | 8 +++++++
|
|
||||||
src/plugins/platformthemes/gtk2/qgtk2theme.h | 3 ++-
|
|
||||||
4 files changed, 33 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
|
||||||
index 4a1d67f..b68aa85 100644
|
|
||||||
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
|
||||||
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
|
||||||
@@ -482,15 +482,23 @@ const char *QGnomeTheme::name = "gnome";
|
|
||||||
class QGnomeThemePrivate : public QPlatformThemePrivate
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
- QGnomeThemePrivate()
|
|
||||||
- : systemFont(QLatin1Literal(defaultSystemFontNameC), defaultSystemFontSize)
|
|
||||||
- , fixedFont(QStringLiteral("monospace"), systemFont.pointSize())
|
|
||||||
+ QGnomeThemePrivate() : fontsConfigured(false) { }
|
|
||||||
+ void configureFonts(QString gtkFontName) const
|
|
||||||
{
|
|
||||||
+ Q_ASSERT(!fontsConfigured);
|
|
||||||
+ const int split = gtkFontName.lastIndexOf(QChar::Space);
|
|
||||||
+ float size = gtkFontName.mid(split+1).toFloat();
|
|
||||||
+ QString fontName = gtkFontName.left(split);
|
|
||||||
+
|
|
||||||
+ systemFont = QFont(fontName, size);
|
|
||||||
+ fixedFont = QFont(QLatin1String("monospace"), systemFont.pointSize());
|
|
||||||
fixedFont.setStyleHint(QFont::TypeWriter);
|
|
||||||
+ fontsConfigured = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
- const QFont systemFont;
|
|
||||||
- QFont fixedFont;
|
|
||||||
+ mutable QFont systemFont;
|
|
||||||
+ mutable QFont fixedFont;
|
|
||||||
+ mutable bool fontsConfigured;
|
|
||||||
};
|
|
||||||
|
|
||||||
QGnomeTheme::QGnomeTheme()
|
|
||||||
@@ -528,9 +536,11 @@ QVariant QGnomeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
|
|
||||||
const QFont *QGnomeTheme::font(Font type) const
|
|
||||||
{
|
|
||||||
Q_D(const QGnomeTheme);
|
|
||||||
+ if (!d->fontsConfigured)
|
|
||||||
+ d->configureFonts(gtkFontName());
|
|
||||||
switch (type) {
|
|
||||||
case QPlatformTheme::SystemFont:
|
|
||||||
- return &d->systemFont;
|
|
||||||
+ return &d->systemFont;
|
|
||||||
case QPlatformTheme::FixedFont:
|
|
||||||
return &d->fixedFont;
|
|
||||||
default:
|
|
||||||
@@ -538,6 +548,11 @@ const QFont *QGnomeTheme::font(Font type) const
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+QString QGnomeTheme::gtkFontName() const
|
|
||||||
+{
|
|
||||||
+ return QStringLiteral("%1 %2").arg(QLatin1String(defaultSystemFontNameC)).arg(defaultSystemFontSize);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
QString QGnomeTheme::standardButtonText(int button) const
|
|
||||||
{
|
|
||||||
switch (button) {
|
|
||||||
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
|
|
||||||
index 36fcdd8..fd65402 100644
|
|
||||||
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
|
|
||||||
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
|
|
||||||
@@ -111,6 +111,8 @@ public:
|
|
||||||
virtual const QFont *font(Font type) const;
|
|
||||||
QString standardButtonText(int button) const Q_DECL_OVERRIDE;
|
|
||||||
|
|
||||||
+ virtual QString gtkFontName() const;
|
|
||||||
+
|
|
||||||
static const char *name;
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/src/plugins/platformthemes/gtk2/qgtk2theme.cpp b/src/plugins/platformthemes/gtk2/qgtk2theme.cpp
|
|
||||||
index 812f4bc..4df3a30 100644
|
|
||||||
--- a/src/plugins/platformthemes/gtk2/qgtk2theme.cpp
|
|
||||||
+++ b/src/plugins/platformthemes/gtk2/qgtk2theme.cpp
|
|
||||||
@@ -85,6 +85,14 @@ QVariant QGtk2Theme::themeHint(QPlatformTheme::ThemeHint hint) const
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+QString QGtk2Theme::gtkFontName() const
|
|
||||||
+{
|
|
||||||
+ QString cfgFontName = gtkSetting("gtk-font-name");
|
|
||||||
+ if (!cfgFontName.isEmpty())
|
|
||||||
+ return cfgFontName;
|
|
||||||
+ return QGnomeTheme::gtkFontName();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
bool QGtk2Theme::usePlatformNativeDialog(DialogType type) const
|
|
||||||
{
|
|
||||||
switch (type) {
|
|
||||||
diff --git a/src/plugins/platformthemes/gtk2/qgtk2theme.h b/src/plugins/platformthemes/gtk2/qgtk2theme.h
|
|
||||||
index a0bd34e..c74e58e 100644
|
|
||||||
--- a/src/plugins/platformthemes/gtk2/qgtk2theme.h
|
|
||||||
+++ b/src/plugins/platformthemes/gtk2/qgtk2theme.h
|
|
||||||
@@ -51,7 +51,8 @@ class QGtk2Theme : public QGnomeTheme
|
|
||||||
public:
|
|
||||||
QGtk2Theme();
|
|
||||||
|
|
||||||
- QVariant themeHint(ThemeHint hint) const;
|
|
||||||
+ virtual QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
|
|
||||||
+ virtual QString gtkFontName() const Q_DECL_OVERRIDE;
|
|
||||||
|
|
||||||
bool usePlatformNativeDialog(DialogType type) const;
|
|
||||||
QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const;
|
|
||||||
--
|
|
||||||
2.1.1
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
|||||||
From a08d09767513ac2d6232f2d6d1cf2bc30974f632 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thiago Macieira <thiago.macieira@intel.com>
|
|
||||||
Date: Tue, 28 Oct 2014 19:34:01 -0700
|
|
||||||
Subject: [PATCH 4/4] Partially revert "Fix a deadlock introduced by the race
|
|
||||||
condition fix"
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
The commit was 9361be58f47ec256bf920c378479a02501219c1f (2008-11-17),
|
|
||||||
referring to the race condition fix that was applied in commit
|
|
||||||
d47c05b1889bb4f06203bbc65f4660b8d0128954 (2008-10-08). The fix for the
|
|
||||||
deadlock reintroduced the race condition and the commit message noted
|
|
||||||
it.
|
|
||||||
|
|
||||||
The workaround is no longer necessary since we've fixed the original race
|
|
||||||
condition differently now (see the previous two commits).
|
|
||||||
|
|
||||||
Task-number: QTBUG-42189
|
|
||||||
Change-Id: I5a83249597a83c4d4caa2ae57964ad3cc61c1d70
|
|
||||||
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
|
|
||||||
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
|
|
||||||
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
|
|
||||||
(cherry picked from commit 73a1e8c60d894701f34806cc4b847aa2814bf389)
|
|
||||||
---
|
|
||||||
src/dbus/qdbusintegrator.cpp | 40 ++++++++++++++--------------------------
|
|
||||||
1 file changed, 14 insertions(+), 26 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
|
|
||||||
index b396c23a1d0c1958971ce76c8b93ab43c9a18c68..c87999a48d5ad2fa39a183fe67aad8021065eb1f 100644
|
|
||||||
--- a/src/dbus/qdbusintegrator.cpp
|
|
||||||
+++ b/src/dbus/qdbusintegrator.cpp
|
|
||||||
@@ -1185,41 +1185,29 @@ void QDBusConnectionPrivate::doDispatch()
|
|
||||||
|
|
||||||
void QDBusConnectionPrivate::socketRead(int fd)
|
|
||||||
{
|
|
||||||
- QVarLengthArray<DBusWatch *, 2> pendingWatches;
|
|
||||||
-
|
|
||||||
- {
|
|
||||||
- QDBusDispatchLocker locker(SocketReadAction, this);
|
|
||||||
- WatcherHash::ConstIterator it = watchers.constFind(fd);
|
|
||||||
- while (it != watchers.constEnd() && it.key() == fd) {
|
|
||||||
- if (it->watch && it->read && it->read->isEnabled())
|
|
||||||
- pendingWatches.append(it.value().watch);
|
|
||||||
- ++it;
|
|
||||||
+ QDBusDispatchLocker locker(SocketReadAction, this);
|
|
||||||
+ WatcherHash::ConstIterator it = watchers.constFind(fd);
|
|
||||||
+ while (it != watchers.constEnd() && it.key() == fd) {
|
|
||||||
+ if (it->watch && it->read && it->read->isEnabled()) {
|
|
||||||
+ if (!q_dbus_watch_handle(it.value().watch, DBUS_WATCH_READABLE))
|
|
||||||
+ qDebug("OUT OF MEM");
|
|
||||||
}
|
|
||||||
+ ++it;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- for (int i = 0; i < pendingWatches.size(); ++i)
|
|
||||||
- if (!q_dbus_watch_handle(pendingWatches[i], DBUS_WATCH_READABLE))
|
|
||||||
- qDebug("OUT OF MEM");
|
|
||||||
doDispatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QDBusConnectionPrivate::socketWrite(int fd)
|
|
||||||
{
|
|
||||||
- QVarLengthArray<DBusWatch *, 2> pendingWatches;
|
|
||||||
-
|
|
||||||
- {
|
|
||||||
- QDBusDispatchLocker locker(SocketWriteAction, this);
|
|
||||||
- WatcherHash::ConstIterator it = watchers.constFind(fd);
|
|
||||||
- while (it != watchers.constEnd() && it.key() == fd) {
|
|
||||||
- if (it->watch && it->write && it->write->isEnabled())
|
|
||||||
- pendingWatches.append(it.value().watch);
|
|
||||||
- ++it;
|
|
||||||
+ QDBusDispatchLocker locker(SocketWriteAction, this);
|
|
||||||
+ WatcherHash::ConstIterator it = watchers.constFind(fd);
|
|
||||||
+ while (it != watchers.constEnd() && it.key() == fd) {
|
|
||||||
+ if (it->watch && it->write && it->write->isEnabled()) {
|
|
||||||
+ if (!q_dbus_watch_handle(it.value().watch, DBUS_WATCH_WRITABLE))
|
|
||||||
+ qDebug("OUT OF MEM");
|
|
||||||
}
|
|
||||||
+ ++it;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- for (int i = 0; i < pendingWatches.size(); ++i)
|
|
||||||
- if (!q_dbus_watch_handle(pendingWatches[i], DBUS_WATCH_WRITABLE))
|
|
||||||
- qDebug("OUT OF MEM");
|
|
||||||
}
|
|
||||||
|
|
||||||
void QDBusConnectionPrivate::objectDestroyed(QObject *obj)
|
|
||||||
--
|
|
||||||
2.1.2
|
|
||||||
|
|
@ -1,284 +0,0 @@
|
|||||||
From 2dcade09fca04dc45848a5a653b160e96aaab1e8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: David Faure <david.faure@kdab.com>
|
|
||||||
Date: Wed, 9 Jul 2014 12:01:05 +0200
|
|
||||||
Subject: [PATCH 4/4] QFileDialog: implement getOpenFileUrl and friends for
|
|
||||||
real
|
|
||||||
|
|
||||||
i.e. make them support remote URLs.
|
|
||||||
To avoid code duplication, getOpenFileName/getSaveFileName/getExistingDirectory
|
|
||||||
are now implemented in terms of getOpenFileUrl/getSaveFileUrl/getExistingDirectoryUrl.
|
|
||||||
|
|
||||||
Change-Id: If409ac9ab72c2a65f04e2ef1dc28e7d47bbcd73c
|
|
||||||
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
|
|
||||||
(cherry picked from commit 1a9701fe81c39450822c0d4b51c11444380a2fe4)
|
|
||||||
|
|
||||||
Conflicts:
|
|
||||||
src/widgets/dialogs/qfiledialog.cpp
|
|
||||||
---
|
|
||||||
src/widgets/dialogs/qfiledialog.cpp | 199 +++++++++++++++---------------------
|
|
||||||
1 file changed, 81 insertions(+), 118 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
|
|
||||||
index ab0361a..bc4a0a3 100644
|
|
||||||
--- a/src/widgets/dialogs/qfiledialog.cpp
|
|
||||||
+++ b/src/widgets/dialogs/qfiledialog.cpp
|
|
||||||
@@ -2110,35 +2110,9 @@ QString QFileDialog::getOpenFileName(QWidget *parent,
|
|
||||||
QString *selectedFilter,
|
|
||||||
Options options)
|
|
||||||
{
|
|
||||||
- QFileDialogArgs args;
|
|
||||||
- args.parent = parent;
|
|
||||||
- args.caption = caption;
|
|
||||||
- args.directory = QFileDialogPrivate::workingDirectory(QUrl::fromLocalFile(dir));
|
|
||||||
- args.selection = QFileDialogPrivate::initialSelection(QUrl::fromLocalFile(dir));
|
|
||||||
- args.filter = filter;
|
|
||||||
- args.mode = ExistingFile;
|
|
||||||
- args.options = options;
|
|
||||||
-#if defined(Q_WS_WIN)
|
|
||||||
- if (QGuiApplicationPrivate::platformIntegration()->usePlatformNativeDialog() && !(args.options & DontUseNativeDialog)) {
|
|
||||||
- return qt_win_get_open_file_name(args, &(args.directory), selectedFilter);
|
|
||||||
- }
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
- // create a qt dialog
|
|
||||||
- QFileDialog dialog(args);
|
|
||||||
- if (selectedFilter && !selectedFilter->isEmpty())
|
|
||||||
- dialog.selectNameFilter(*selectedFilter);
|
|
||||||
- if (dialog.exec() == QDialog::Accepted) {
|
|
||||||
- if (selectedFilter)
|
|
||||||
- *selectedFilter = dialog.selectedNameFilter();
|
|
||||||
- return dialog.selectedFiles().value(0);
|
|
||||||
- }
|
|
||||||
- return QString();
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-static inline QUrl dialogResultToUrl(const QString &file)
|
|
||||||
-{
|
|
||||||
- return file.isEmpty() ? QUrl() : QUrl::fromLocalFile(file);
|
|
||||||
+ const QStringList schemes = QStringList(QStringLiteral("file"));
|
|
||||||
+ const QUrl selectedUrl = getOpenFileUrl(parent, caption, QUrl::fromLocalFile(dir), filter, selectedFilter, options, schemes);
|
|
||||||
+ return selectedUrl.toLocalFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@@ -2176,10 +2150,26 @@ QUrl QFileDialog::getOpenFileUrl(QWidget *parent,
|
|
||||||
Options options,
|
|
||||||
const QStringList &supportedSchemes)
|
|
||||||
{
|
|
||||||
- Q_UNUSED(supportedSchemes);
|
|
||||||
+ Q_UNUSED(supportedSchemes); // TODO
|
|
||||||
+
|
|
||||||
+ QFileDialogArgs args;
|
|
||||||
+ args.parent = parent;
|
|
||||||
+ args.caption = caption;
|
|
||||||
+ args.directory = QFileDialogPrivate::workingDirectory(dir);
|
|
||||||
+ args.selection = QFileDialogPrivate::initialSelection(dir);
|
|
||||||
+ args.filter = filter;
|
|
||||||
+ args.mode = ExistingFile;
|
|
||||||
+ args.options = options;
|
|
||||||
|
|
||||||
- // Falls back to local file
|
|
||||||
- return dialogResultToUrl(getOpenFileName(parent, caption, dir.toLocalFile(), filter, selectedFilter, options));
|
|
||||||
+ QFileDialog dialog(args);
|
|
||||||
+ if (selectedFilter && !selectedFilter->isEmpty())
|
|
||||||
+ dialog.selectNameFilter(*selectedFilter);
|
|
||||||
+ if (dialog.exec() == QDialog::Accepted) {
|
|
||||||
+ if (selectedFilter)
|
|
||||||
+ *selectedFilter = dialog.selectedNameFilter();
|
|
||||||
+ return dialog.selectedUrls().value(0);
|
|
||||||
+ }
|
|
||||||
+ return QUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@@ -2238,31 +2228,12 @@ QStringList QFileDialog::getOpenFileNames(QWidget *parent,
|
|
||||||
QString *selectedFilter,
|
|
||||||
Options options)
|
|
||||||
{
|
|
||||||
- QFileDialogArgs args;
|
|
||||||
- args.parent = parent;
|
|
||||||
- args.caption = caption;
|
|
||||||
- args.directory = QFileDialogPrivate::workingDirectory(QUrl::fromLocalFile(dir));
|
|
||||||
- args.selection = QFileDialogPrivate::initialSelection(QUrl::fromLocalFile(dir));
|
|
||||||
- args.filter = filter;
|
|
||||||
- args.mode = ExistingFiles;
|
|
||||||
- args.options = options;
|
|
||||||
-
|
|
||||||
-#if defined(Q_WS_WIN)
|
|
||||||
- if (QGuiApplicationPrivate::platformIntegration()->usePlatformNativeDialog() && !(args.options & DontUseNativeDialog)) {
|
|
||||||
- return qt_win_get_open_file_names(args, &(args.directory), selectedFilter);
|
|
||||||
- }
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
- // create a qt dialog
|
|
||||||
- QFileDialog dialog(args);
|
|
||||||
- if (selectedFilter && !selectedFilter->isEmpty())
|
|
||||||
- dialog.selectNameFilter(*selectedFilter);
|
|
||||||
- if (dialog.exec() == QDialog::Accepted) {
|
|
||||||
- if (selectedFilter)
|
|
||||||
- *selectedFilter = dialog.selectedNameFilter();
|
|
||||||
- return dialog.selectedFiles();
|
|
||||||
- }
|
|
||||||
- return QStringList();
|
|
||||||
+ const QStringList schemes = QStringList(QStringLiteral("file"));
|
|
||||||
+ const QList<QUrl> selectedUrls = getOpenFileUrls(parent, caption, QUrl::fromLocalFile(dir), filter, selectedFilter, options, schemes);
|
|
||||||
+ QStringList fileNames;
|
|
||||||
+ foreach (const QUrl &url, selectedUrls)
|
|
||||||
+ fileNames << url.toLocalFile();
|
|
||||||
+ return fileNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@@ -2303,14 +2274,24 @@ QList<QUrl> QFileDialog::getOpenFileUrls(QWidget *parent,
|
|
||||||
{
|
|
||||||
Q_UNUSED(supportedSchemes);
|
|
||||||
|
|
||||||
- // Falls back to local files
|
|
||||||
- QList<QUrl> urls;
|
|
||||||
-
|
|
||||||
- const QStringList fileNames = getOpenFileNames(parent, caption, dir.toLocalFile(), filter, selectedFilter, options);
|
|
||||||
- foreach (const QString &fileName, fileNames)
|
|
||||||
- urls << QUrl::fromLocalFile(fileName);
|
|
||||||
+ QFileDialogArgs args;
|
|
||||||
+ args.parent = parent;
|
|
||||||
+ args.caption = caption;
|
|
||||||
+ args.directory = QFileDialogPrivate::workingDirectory(dir);
|
|
||||||
+ args.selection = QFileDialogPrivate::initialSelection(dir);
|
|
||||||
+ args.filter = filter;
|
|
||||||
+ args.mode = ExistingFiles;
|
|
||||||
+ args.options = options;
|
|
||||||
|
|
||||||
- return urls;
|
|
||||||
+ QFileDialog dialog(args);
|
|
||||||
+ if (selectedFilter && !selectedFilter->isEmpty())
|
|
||||||
+ dialog.selectNameFilter(*selectedFilter);
|
|
||||||
+ if (dialog.exec() == QDialog::Accepted) {
|
|
||||||
+ if (selectedFilter)
|
|
||||||
+ *selectedFilter = dialog.selectedNameFilter();
|
|
||||||
+ return dialog.selectedUrls();
|
|
||||||
+ }
|
|
||||||
+ return QList<QUrl>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@@ -2370,33 +2351,9 @@ QString QFileDialog::getSaveFileName(QWidget *parent,
|
|
||||||
QString *selectedFilter,
|
|
||||||
Options options)
|
|
||||||
{
|
|
||||||
- QFileDialogArgs args;
|
|
||||||
- args.parent = parent;
|
|
||||||
- args.caption = caption;
|
|
||||||
- args.directory = QFileDialogPrivate::workingDirectory(QUrl::fromLocalFile(dir));
|
|
||||||
- args.selection = QFileDialogPrivate::initialSelection(QUrl::fromLocalFile(dir));
|
|
||||||
- args.filter = filter;
|
|
||||||
- args.mode = AnyFile;
|
|
||||||
- args.options = options;
|
|
||||||
-
|
|
||||||
-#if defined(Q_WS_WIN)
|
|
||||||
- if (QGuiApplicationPrivate::platformIntegration()->usePlatformNativeDialog() && !(args.options & DontUseNativeDialog)) {
|
|
||||||
- return qt_win_get_save_file_name(args, &(args.directory), selectedFilter);
|
|
||||||
- }
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
- // create a qt dialog
|
|
||||||
- QFileDialog dialog(args);
|
|
||||||
- dialog.setAcceptMode(AcceptSave);
|
|
||||||
- if (selectedFilter && !selectedFilter->isEmpty())
|
|
||||||
- dialog.selectNameFilter(*selectedFilter);
|
|
||||||
- if (dialog.exec() == QDialog::Accepted) {
|
|
||||||
- if (selectedFilter)
|
|
||||||
- *selectedFilter = dialog.selectedNameFilter();
|
|
||||||
- return dialog.selectedFiles().value(0);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- return QString();
|
|
||||||
+ const QStringList schemes = QStringList(QStringLiteral("file"));
|
|
||||||
+ const QUrl selectedUrl = getSaveFileUrl(parent, caption, QUrl::fromLocalFile(dir), filter, selectedFilter, options, schemes);
|
|
||||||
+ return selectedUrl.toLocalFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@@ -2436,8 +2393,25 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent,
|
|
||||||
{
|
|
||||||
Q_UNUSED(supportedSchemes);
|
|
||||||
|
|
||||||
- // Falls back to local file
|
|
||||||
- return dialogResultToUrl(getSaveFileName(parent, caption, dir.toLocalFile(), filter, selectedFilter, options));
|
|
||||||
+ QFileDialogArgs args;
|
|
||||||
+ args.parent = parent;
|
|
||||||
+ args.caption = caption;
|
|
||||||
+ args.directory = QFileDialogPrivate::workingDirectory(dir);
|
|
||||||
+ args.selection = QFileDialogPrivate::initialSelection(dir);
|
|
||||||
+ args.filter = filter;
|
|
||||||
+ args.mode = AnyFile;
|
|
||||||
+ args.options = options;
|
|
||||||
+
|
|
||||||
+ QFileDialog dialog(args);
|
|
||||||
+ dialog.setAcceptMode(AcceptSave);
|
|
||||||
+ if (selectedFilter && !selectedFilter->isEmpty())
|
|
||||||
+ dialog.selectNameFilter(*selectedFilter);
|
|
||||||
+ if (dialog.exec() == QDialog::Accepted) {
|
|
||||||
+ if (selectedFilter)
|
|
||||||
+ *selectedFilter = dialog.selectedNameFilter();
|
|
||||||
+ return dialog.selectedUrls().value(0);
|
|
||||||
+ }
|
|
||||||
+ return QUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@@ -2484,29 +2458,9 @@ QString QFileDialog::getExistingDirectory(QWidget *parent,
|
|
||||||
const QString &dir,
|
|
||||||
Options options)
|
|
||||||
{
|
|
||||||
- QFileDialogArgs args;
|
|
||||||
- args.parent = parent;
|
|
||||||
- args.caption = caption;
|
|
||||||
- args.directory = QFileDialogPrivate::workingDirectory(QUrl::fromLocalFile(dir));
|
|
||||||
- args.mode = (options & ShowDirsOnly ? DirectoryOnly : Directory);
|
|
||||||
- args.options = options;
|
|
||||||
-
|
|
||||||
-#if defined(Q_WS_WIN)
|
|
||||||
- if (QGuiApplicationPrivate::platformIntegration()->usePlatformNativeDialog() && !(args.options & DontUseNativeDialog) && (options & ShowDirsOnly)
|
|
||||||
-#if defined(Q_OS_WINCE)
|
|
||||||
- && qt_priv_ptr_valid
|
|
||||||
-#endif
|
|
||||||
- ) {
|
|
||||||
- return qt_win_get_existing_directory(args);
|
|
||||||
- }
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
- // create a qt dialog
|
|
||||||
- QFileDialog dialog(args);
|
|
||||||
- if (dialog.exec() == QDialog::Accepted) {
|
|
||||||
- return dialog.selectedFiles().value(0);
|
|
||||||
- }
|
|
||||||
- return QString();
|
|
||||||
+ const QStringList schemes = QStringList(QStringLiteral("file"));
|
|
||||||
+ const QUrl selectedUrl = getExistingDirectoryUrl(parent, caption, QUrl::fromLocalFile(dir), options, schemes);
|
|
||||||
+ return selectedUrl.toLocalFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@@ -2544,8 +2498,17 @@ QUrl QFileDialog::getExistingDirectoryUrl(QWidget *parent,
|
|
||||||
{
|
|
||||||
Q_UNUSED(supportedSchemes);
|
|
||||||
|
|
||||||
- // Falls back to local file
|
|
||||||
- return dialogResultToUrl(getExistingDirectory(parent, caption, dir.toLocalFile(), options));
|
|
||||||
+ QFileDialogArgs args;
|
|
||||||
+ args.parent = parent;
|
|
||||||
+ args.caption = caption;
|
|
||||||
+ args.directory = QFileDialogPrivate::workingDirectory(dir);
|
|
||||||
+ args.mode = (options & ShowDirsOnly ? DirectoryOnly : Directory);
|
|
||||||
+ args.options = options;
|
|
||||||
+
|
|
||||||
+ QFileDialog dialog(args);
|
|
||||||
+ if (dialog.exec() == QDialog::Accepted)
|
|
||||||
+ return dialog.selectedUrls().value(0);
|
|
||||||
+ return QUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline static QUrl _qt_get_directory(const QUrl &url)
|
|
||||||
--
|
|
||||||
2.1.1
|
|
||||||
|
|
32
Handle-SelectionClientClose-in-QXcbClipboard.patch
Normal file
32
Handle-SelectionClientClose-in-QXcbClipboard.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From: Martin Gräßlin <mgraesslin@kde.org>
|
||||||
|
Date: Wed, 10 Dec 2014 06:27:23 +0000
|
||||||
|
Subject: Handle SelectionClientClose in QXcbClipboard
|
||||||
|
X-Git-Url: http://quickgit.kde.org/?p=qt%2Fqtbase.git&a=commitdiff&h=6a7ee92b3958e3a3ebc16be15f8bd34217ec7bd2
|
||||||
|
---
|
||||||
|
Handle SelectionClientClose in QXcbClipboard
|
||||||
|
|
||||||
|
QXcbClipboard listens for subtype SelectionClientClose of Xfixes
|
||||||
|
SelectionNotify event, but doesn't handle it. When the client holding
|
||||||
|
the clipboard selection closes the Clipboard becomes empty and thus the
|
||||||
|
change should be emitted.
|
||||||
|
|
||||||
|
This fixes downstream KDE Bug #329174.
|
||||||
|
|
||||||
|
Change-Id: I19fb8cfd7bd3b249c0bc6ca2a724a9aeeb05ac7e
|
||||||
|
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
|
||||||
|
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
--- a/src/plugins/platforms/xcb/qxcbclipboard.cpp
|
||||||
|
+++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp
|
||||||
|
@@ -742,7 +742,8 @@
|
||||||
|
m_xClipboard[mode]->reset();
|
||||||
|
}
|
||||||
|
emitChanged(mode);
|
||||||
|
- }
|
||||||
|
+ } else if (event->subtype == XCB_XFIXES_SELECTION_EVENT_SELECTION_CLIENT_CLOSE)
|
||||||
|
+ emitChanged(mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,343 +0,0 @@
|
|||||||
From f1ee10f81ac18789e9a7dc715b464415ba2bc2b8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <mgraesslin@kde.org>
|
|
||||||
Date: Wed, 19 Feb 2014 11:01:44 +0100
|
|
||||||
Subject: [PATCH] Prefer QPA implementation in qsystemtrayicon_x11 if available
|
|
||||||
|
|
||||||
In order to have the possibility to provide a custom QSystemTrayIcon
|
|
||||||
implementation in the platform theme instead of the X11 xembed based
|
|
||||||
one, the qpa implementation needs to be called. This was not possible
|
|
||||||
as qpa and x11 implementation were compile time mutual exclusive.
|
|
||||||
|
|
||||||
This change moves the qpa implementation in the shared part and the
|
|
||||||
methods in qsystemtrayicon_qpa just delegate to them. In addition the
|
|
||||||
_x11 part tries to create a QPlatformSystemTrayIcon through the
|
|
||||||
platform theme and if that succeeds the implementation prefers the qpa
|
|
||||||
variant and delegates to the same methods.
|
|
||||||
|
|
||||||
Change-Id: I6b33acac63524a77ebdce39af6eb74666f8c7561
|
|
||||||
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
|
|
||||||
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
|
|
||||||
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
|
|
||||||
---
|
|
||||||
src/widgets/util/qsystemtrayicon.cpp | 68 ++++++++++++++++++++++++++++++
|
|
||||||
src/widgets/util/qsystemtrayicon_p.h | 9 ++++
|
|
||||||
src/widgets/util/qsystemtrayicon_qpa.cpp | 51 ++++------------------
|
|
||||||
src/widgets/util/qsystemtrayicon_x11.cpp | 40 +++++++++++++++++-
|
|
||||||
4 files changed, 126 insertions(+), 42 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
|
|
||||||
index f1a69e6..fa318f3 100644
|
|
||||||
--- a/src/widgets/util/qsystemtrayicon.cpp
|
|
||||||
+++ b/src/widgets/util/qsystemtrayicon.cpp
|
|
||||||
@@ -672,6 +672,74 @@ void QBalloonTip::timerEvent(QTimerEvent *e)
|
|
||||||
QWidget::timerEvent(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
+//////////////////////////////////////////////////////////////////////
|
|
||||||
+void QSystemTrayIconPrivate::install_sys_qpa()
|
|
||||||
+{
|
|
||||||
+ qpa_sys->init();
|
|
||||||
+ QObject::connect(qpa_sys, SIGNAL(activated(QPlatformSystemTrayIcon::ActivationReason)),
|
|
||||||
+ q_func(), SLOT(_q_emitActivated(QPlatformSystemTrayIcon::ActivationReason)));
|
|
||||||
+ QObject::connect(qpa_sys, &QPlatformSystemTrayIcon::messageClicked,
|
|
||||||
+ q_func(), &QSystemTrayIcon::messageClicked);
|
|
||||||
+ updateMenu_sys();
|
|
||||||
+ updateIcon_sys();
|
|
||||||
+ updateToolTip_sys();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void QSystemTrayIconPrivate::remove_sys_qpa()
|
|
||||||
+{
|
|
||||||
+ qpa_sys->cleanup();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+QRect QSystemTrayIconPrivate::geometry_sys_qpa() const
|
|
||||||
+{
|
|
||||||
+ return qpa_sys->geometry();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void QSystemTrayIconPrivate::updateIcon_sys_qpa()
|
|
||||||
+{
|
|
||||||
+ qpa_sys->updateIcon(icon);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void QSystemTrayIconPrivate::updateMenu_sys_qpa()
|
|
||||||
+{
|
|
||||||
+ if (menu) {
|
|
||||||
+ if (!menu->platformMenu()) {
|
|
||||||
+ QPlatformMenu *platformMenu = qpa_sys->createMenu();
|
|
||||||
+ if (platformMenu)
|
|
||||||
+ menu->setPlatformMenu(platformMenu);
|
|
||||||
+ }
|
|
||||||
+ qpa_sys->updateMenu(menu->platformMenu());
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void QSystemTrayIconPrivate::updateToolTip_sys_qpa()
|
|
||||||
+{
|
|
||||||
+ qpa_sys->updateToolTip(toolTip);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void QSystemTrayIconPrivate::showMessage_sys_qpa(const QString &message,
|
|
||||||
+ const QString &title,
|
|
||||||
+ QSystemTrayIcon::MessageIcon icon,
|
|
||||||
+ int msecs)
|
|
||||||
+{
|
|
||||||
+ QIcon notificationIcon;
|
|
||||||
+ switch (icon) {
|
|
||||||
+ case QSystemTrayIcon::Information:
|
|
||||||
+ notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation);
|
|
||||||
+ break;
|
|
||||||
+ case QSystemTrayIcon::Warning:
|
|
||||||
+ notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning);
|
|
||||||
+ break;
|
|
||||||
+ case QSystemTrayIcon::Critical:
|
|
||||||
+ notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical);
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ qpa_sys->showMessage(message, title, notificationIcon,
|
|
||||||
+ static_cast<QPlatformSystemTrayIcon::MessageIcon>(icon), msecs);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // QT_NO_SYSTEMTRAYICON
|
|
||||||
diff --git a/src/widgets/util/qsystemtrayicon_p.h b/src/widgets/util/qsystemtrayicon_p.h
|
|
||||||
index 211ef30..317664a 100644
|
|
||||||
--- a/src/widgets/util/qsystemtrayicon_p.h
|
|
||||||
+++ b/src/widgets/util/qsystemtrayicon_p.h
|
|
||||||
@@ -98,6 +98,15 @@ public:
|
|
||||||
QSystemTrayIconSys *sys;
|
|
||||||
QPlatformSystemTrayIcon *qpa_sys;
|
|
||||||
bool visible;
|
|
||||||
+
|
|
||||||
+private:
|
|
||||||
+ void install_sys_qpa();
|
|
||||||
+ void remove_sys_qpa();
|
|
||||||
+ void updateIcon_sys_qpa();
|
|
||||||
+ void updateToolTip_sys_qpa();
|
|
||||||
+ void updateMenu_sys_qpa();
|
|
||||||
+ QRect geometry_sys_qpa() const;
|
|
||||||
+ void showMessage_sys_qpa(const QString &msg, const QString &title, QSystemTrayIcon::MessageIcon icon, int secs);
|
|
||||||
};
|
|
||||||
|
|
||||||
class QBalloonTip : public QWidget
|
|
||||||
diff --git a/src/widgets/util/qsystemtrayicon_qpa.cpp b/src/widgets/util/qsystemtrayicon_qpa.cpp
|
|
||||||
index f98aeaf..045641c 100644
|
|
||||||
--- a/src/widgets/util/qsystemtrayicon_qpa.cpp
|
|
||||||
+++ b/src/widgets/util/qsystemtrayicon_qpa.cpp
|
|
||||||
@@ -65,28 +65,20 @@ QSystemTrayIconPrivate::~QSystemTrayIconPrivate()
|
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::install_sys()
|
|
||||||
{
|
|
||||||
- if (qpa_sys) {
|
|
||||||
- qpa_sys->init();
|
|
||||||
- QObject::connect(qpa_sys, SIGNAL(activated(QPlatformSystemTrayIcon::ActivationReason)),
|
|
||||||
- q_func(), SLOT(_q_emitActivated(QPlatformSystemTrayIcon::ActivationReason)));
|
|
||||||
- QObject::connect(qpa_sys, SIGNAL(messageClicked()),
|
|
||||||
- q_func(), SIGNAL(messageClicked()));
|
|
||||||
- updateMenu_sys();
|
|
||||||
- updateIcon_sys();
|
|
||||||
- updateToolTip_sys();
|
|
||||||
- }
|
|
||||||
+ if (qpa_sys)
|
|
||||||
+ install_sys_qpa();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::remove_sys()
|
|
||||||
{
|
|
||||||
if (qpa_sys)
|
|
||||||
- qpa_sys->cleanup();
|
|
||||||
+ remove_sys_qpa();
|
|
||||||
}
|
|
||||||
|
|
||||||
QRect QSystemTrayIconPrivate::geometry_sys() const
|
|
||||||
{
|
|
||||||
if (qpa_sys)
|
|
||||||
- return qpa_sys->geometry();
|
|
||||||
+ return geometry_sys_qpa();
|
|
||||||
else
|
|
||||||
return QRect();
|
|
||||||
}
|
|
||||||
@@ -94,25 +86,19 @@ QRect QSystemTrayIconPrivate::geometry_sys() const
|
|
||||||
void QSystemTrayIconPrivate::updateIcon_sys()
|
|
||||||
{
|
|
||||||
if (qpa_sys)
|
|
||||||
- qpa_sys->updateIcon(icon);
|
|
||||||
+ updateIcon_sys_qpa();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::updateMenu_sys()
|
|
||||||
{
|
|
||||||
- if (qpa_sys && menu) {
|
|
||||||
- if (!menu->platformMenu()) {
|
|
||||||
- QPlatformMenu *platformMenu = qpa_sys->createMenu();
|
|
||||||
- if (platformMenu)
|
|
||||||
- menu->setPlatformMenu(platformMenu);
|
|
||||||
- }
|
|
||||||
- qpa_sys->updateMenu(menu->platformMenu());
|
|
||||||
- }
|
|
||||||
+ if (qpa_sys)
|
|
||||||
+ updateMenu_sys_qpa();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::updateToolTip_sys()
|
|
||||||
{
|
|
||||||
if (qpa_sys)
|
|
||||||
- qpa_sys->updateToolTip(toolTip);
|
|
||||||
+ updateToolTip_sys_qpa();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys()
|
|
||||||
@@ -138,25 +124,8 @@ void QSystemTrayIconPrivate::showMessage_sys(const QString &message,
|
|
||||||
QSystemTrayIcon::MessageIcon icon,
|
|
||||||
int msecs)
|
|
||||||
{
|
|
||||||
- if (!qpa_sys)
|
|
||||||
- return;
|
|
||||||
-
|
|
||||||
- QIcon notificationIcon;
|
|
||||||
- switch (icon) {
|
|
||||||
- case QSystemTrayIcon::Information:
|
|
||||||
- notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation);
|
|
||||||
- break;
|
|
||||||
- case QSystemTrayIcon::Warning:
|
|
||||||
- notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning);
|
|
||||||
- break;
|
|
||||||
- case QSystemTrayIcon::Critical:
|
|
||||||
- notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical);
|
|
||||||
- break;
|
|
||||||
- default:
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- qpa_sys->showMessage(message, title, notificationIcon,
|
|
||||||
- static_cast<QPlatformSystemTrayIcon::MessageIcon>(icon), msecs);
|
|
||||||
+ if (qpa_sys)
|
|
||||||
+ showMessage_sys_qpa(message, title, icon, msecs);
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
|
|
||||||
index 347e570..27d0418 100644
|
|
||||||
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
|
|
||||||
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
|
|
||||||
@@ -55,6 +55,9 @@
|
|
||||||
#include <qscreen.h>
|
|
||||||
#include <qbackingstore.h>
|
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
|
||||||
+#include <qpa/qplatformsystemtrayicon.h>
|
|
||||||
+#include <qpa/qplatformtheme.h>
|
|
||||||
+#include <private/qguiapplication_p.h>
|
|
||||||
#include <qdebug.h>
|
|
||||||
|
|
||||||
#ifndef QT_NO_SYSTEMTRAYICON
|
|
||||||
@@ -209,16 +212,22 @@ void QSystemTrayIconSys::paintEvent(QPaintEvent *)
|
|
||||||
|
|
||||||
QSystemTrayIconPrivate::QSystemTrayIconPrivate()
|
|
||||||
: sys(0),
|
|
||||||
+ qpa_sys(QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon()),
|
|
||||||
visible(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QSystemTrayIconPrivate::~QSystemTrayIconPrivate()
|
|
||||||
{
|
|
||||||
+ delete qpa_sys;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::install_sys()
|
|
||||||
{
|
|
||||||
+ if (qpa_sys) {
|
|
||||||
+ install_sys_qpa();
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
Q_Q(QSystemTrayIcon);
|
|
||||||
if (!sys && locateSystemTray()) {
|
|
||||||
sys = new QSystemTrayIconSys(q);
|
|
||||||
@@ -229,6 +238,8 @@ void QSystemTrayIconPrivate::install_sys()
|
|
||||||
|
|
||||||
QRect QSystemTrayIconPrivate::geometry_sys() const
|
|
||||||
{
|
|
||||||
+ if (qpa_sys)
|
|
||||||
+ return geometry_sys_qpa();
|
|
||||||
if (!sys)
|
|
||||||
return QRect();
|
|
||||||
return sys->globalGeometry();
|
|
||||||
@@ -236,6 +247,10 @@ QRect QSystemTrayIconPrivate::geometry_sys() const
|
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::remove_sys()
|
|
||||||
{
|
|
||||||
+ if (qpa_sys) {
|
|
||||||
+ remove_sys_qpa();
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
if (!sys)
|
|
||||||
return;
|
|
||||||
QBalloonTip::hideBalloon();
|
|
||||||
@@ -246,17 +261,26 @@ void QSystemTrayIconPrivate::remove_sys()
|
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::updateIcon_sys()
|
|
||||||
{
|
|
||||||
+ if (qpa_sys) {
|
|
||||||
+ updateIcon_sys_qpa();
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
if (sys)
|
|
||||||
sys->updateIcon();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::updateMenu_sys()
|
|
||||||
{
|
|
||||||
-
|
|
||||||
+ if (qpa_sys)
|
|
||||||
+ updateMenu_sys_qpa();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::updateToolTip_sys()
|
|
||||||
{
|
|
||||||
+ if (qpa_sys) {
|
|
||||||
+ updateToolTip_sys_qpa();
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
if (!sys)
|
|
||||||
return;
|
|
||||||
#ifndef QT_NO_TOOLTIP
|
|
||||||
@@ -266,6 +290,11 @@ void QSystemTrayIconPrivate::updateToolTip_sys()
|
|
||||||
|
|
||||||
bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys()
|
|
||||||
{
|
|
||||||
+ QScopedPointer<QPlatformSystemTrayIcon> sys(QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon());
|
|
||||||
+ if (sys)
|
|
||||||
+ return sys->isSystemTrayAvailable();
|
|
||||||
+
|
|
||||||
+ // no QPlatformSystemTrayIcon so fall back to default xcb platform behavior
|
|
||||||
const QString platform = QGuiApplication::platformName();
|
|
||||||
if (platform.compare(QStringLiteral("xcb"), Qt::CaseInsensitive) == 0)
|
|
||||||
return locateSystemTray();
|
|
||||||
@@ -274,12 +303,21 @@ bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys()
|
|
||||||
|
|
||||||
bool QSystemTrayIconPrivate::supportsMessages_sys()
|
|
||||||
{
|
|
||||||
+ QScopedPointer<QPlatformSystemTrayIcon> sys(QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon());
|
|
||||||
+ if (sys)
|
|
||||||
+ return sys->supportsMessages();
|
|
||||||
+
|
|
||||||
+ // no QPlatformSystemTrayIcon so fall back to default xcb platform behavior
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::showMessage_sys(const QString &message, const QString &title,
|
|
||||||
QSystemTrayIcon::MessageIcon icon, int msecs)
|
|
||||||
{
|
|
||||||
+ if (qpa_sys) {
|
|
||||||
+ showMessage_sys_qpa(message, title, icon, msecs);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
if (!sys)
|
|
||||||
return;
|
|
||||||
const QPoint g = sys->globalGeometry().topLeft();
|
|
||||||
--
|
|
||||||
1.7.1
|
|
||||||
|
|
@ -1,122 +0,0 @@
|
|||||||
From a3ed9b781cb0e1fa4ae3b1cedcd63bd394903db7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Egbert Eich <eich@suse.de>
|
|
||||||
Date: Tue, 18 Mar 2014 18:29:02 +0100
|
|
||||||
Subject: [PATCH] [xcb/xsettings] Add support for byte swapping
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
The XSettings protocol is not endian neutral. Instead it holds
|
|
||||||
information about endianness in the first byte. It uses the same
|
|
||||||
convention as X11/X.h does.
|
|
||||||
So far byte order handling was missing leading to nasty crashes
|
|
||||||
when byte order between clients setting and reading XSettings
|
|
||||||
differed. This patch fixes this.
|
|
||||||
Using the X11/X.h conventions seems to be an 'established standard',
|
|
||||||
this piece is missing from the Xsettings specifications. Therefore
|
|
||||||
this fix may introduce spurious regressions as other Xsettings
|
|
||||||
'providers' may use a different convention. To detect this and
|
|
||||||
to avoid crashes the fix also adds checks to avoid reading past
|
|
||||||
the end of the of the Xsettings data blob. If problems are
|
|
||||||
encountered: warn and bail.
|
|
||||||
|
|
||||||
Change-Id: If8acb23cca2478369633129af2d99e122a84cede
|
|
||||||
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
|
|
||||||
---
|
|
||||||
src/plugins/platforms/xcb/qxcbxsettings.cpp | 43 +++++++++++++++++++++--------
|
|
||||||
1 file changed, 32 insertions(+), 11 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp
|
|
||||||
index 141a6cc..26d95e9 100644
|
|
||||||
--- a/src/plugins/platforms/xcb/qxcbxsettings.cpp
|
|
||||||
+++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp
|
|
||||||
@@ -42,6 +42,7 @@
|
|
||||||
#include "qxcbxsettings.h"
|
|
||||||
|
|
||||||
#include <QtCore/QByteArray>
|
|
||||||
+#include <QtCore/QtEndian>
|
|
||||||
|
|
||||||
#include <X11/extensions/XIproto.h>
|
|
||||||
|
|
||||||
@@ -149,47 +150,67 @@ public:
|
|
||||||
{
|
|
||||||
if (xSettings.length() < 12)
|
|
||||||
return;
|
|
||||||
- // we ignore byteorder for now
|
|
||||||
char byteOrder = xSettings.at(1);
|
|
||||||
- Q_UNUSED(byteOrder);
|
|
||||||
- uint number_of_settings = *reinterpret_cast<const uint *>(xSettings.mid(8,4).constData());
|
|
||||||
+ if (byteOrder != LSBFirst && byteOrder != MSBFirst) {
|
|
||||||
+ qWarning("%s ByteOrder byte %d not 0 or 1", Q_FUNC_INFO , byteOrder);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+#define ADJUST_BO(b, t, x) \
|
|
||||||
+ ((b == LSBFirst) ? \
|
|
||||||
+ qFromLittleEndian<t>((const uchar *)(x)) : \
|
|
||||||
+ qFromBigEndian<t>((const uchar *)(x)))
|
|
||||||
+#define VALIDATE_LENGTH(x) \
|
|
||||||
+ if ((size_t)xSettings.length() < (offset + local_offset + 12 + x)) { \
|
|
||||||
+ qWarning("%s Length %d runs past end of data", Q_FUNC_INFO , x); \
|
|
||||||
+ return; \
|
|
||||||
+ }
|
|
||||||
|
|
||||||
+ uint number_of_settings = ADJUST_BO(byteOrder, quint32, xSettings.mid(8,4).constData());
|
|
||||||
const char *data = xSettings.constData() + 12;
|
|
||||||
size_t offset = 0;
|
|
||||||
for (uint i = 0; i < number_of_settings; i++) {
|
|
||||||
int local_offset = 0;
|
|
||||||
+ VALIDATE_LENGTH(2);
|
|
||||||
XSettingsType type = static_cast<XSettingsType>(*reinterpret_cast<const quint8 *>(data + offset));
|
|
||||||
local_offset += 2;
|
|
||||||
|
|
||||||
- quint16 name_len = *reinterpret_cast<const quint16 *>(data + offset + local_offset);
|
|
||||||
+ VALIDATE_LENGTH(2);
|
|
||||||
+ quint16 name_len = ADJUST_BO(byteOrder, quint16, data + offset + local_offset);
|
|
||||||
local_offset += 2;
|
|
||||||
|
|
||||||
+ VALIDATE_LENGTH(name_len);
|
|
||||||
QByteArray name(data + offset + local_offset, name_len);
|
|
||||||
local_offset += round_to_nearest_multiple_of_4(name_len);
|
|
||||||
|
|
||||||
- int last_change_serial = *reinterpret_cast<const int *>(data + offset + local_offset);
|
|
||||||
+ VALIDATE_LENGTH(4);
|
|
||||||
+ int last_change_serial = ADJUST_BO(byteOrder, qint32, data + offset + local_offset);
|
|
||||||
Q_UNUSED(last_change_serial);
|
|
||||||
local_offset += 4;
|
|
||||||
|
|
||||||
QVariant value;
|
|
||||||
if (type == XSettingsTypeString) {
|
|
||||||
- int value_length = *reinterpret_cast<const int *>(data + offset + local_offset);
|
|
||||||
+ VALIDATE_LENGTH(4);
|
|
||||||
+ int value_length = ADJUST_BO(byteOrder, qint32, data + offset + local_offset);
|
|
||||||
local_offset+=4;
|
|
||||||
+ VALIDATE_LENGTH(value_length);
|
|
||||||
QByteArray value_string(data + offset + local_offset, value_length);
|
|
||||||
value.setValue(value_string);
|
|
||||||
local_offset += round_to_nearest_multiple_of_4(value_length);
|
|
||||||
} else if (type == XSettingsTypeInteger) {
|
|
||||||
- int value_length = *reinterpret_cast<const int *>(data + offset + local_offset);
|
|
||||||
+ VALIDATE_LENGTH(4);
|
|
||||||
+ int value_length = ADJUST_BO(byteOrder, qint32, data + offset + local_offset);
|
|
||||||
local_offset += 4;
|
|
||||||
value.setValue(value_length);
|
|
||||||
} else if (type == XSettingsTypeColor) {
|
|
||||||
- quint16 red = *reinterpret_cast<const quint16 *>(data + offset + local_offset);
|
|
||||||
+ VALIDATE_LENGTH(2*4);
|
|
||||||
+ quint16 red = ADJUST_BO(byteOrder, quint16, data + offset + local_offset);
|
|
||||||
local_offset += 2;
|
|
||||||
- quint16 green = *reinterpret_cast<const quint16 *>(data + offset + local_offset);
|
|
||||||
+ quint16 green = ADJUST_BO(byteOrder, quint16, data + offset + local_offset);
|
|
||||||
local_offset += 2;
|
|
||||||
- quint16 blue = *reinterpret_cast<const quint16 *>(data + offset + local_offset);
|
|
||||||
+ quint16 blue = ADJUST_BO(byteOrder, quint16, data + offset + local_offset);
|
|
||||||
local_offset += 2;
|
|
||||||
- quint16 alpha= *reinterpret_cast<const quint16 *>(data + offset + local_offset);
|
|
||||||
+ quint16 alpha= ADJUST_BO(byteOrder, quint16, data + offset + local_offset);
|
|
||||||
local_offset += 2;
|
|
||||||
QColor color_value(red,green,blue,alpha);
|
|
||||||
value.setValue(color_value);
|
|
||||||
--
|
|
||||||
1.8.4.5
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
From 5819ffe492cf3cd98718819b1bd837819318d82e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Egbert Eich <eich@suse.de>
|
|
||||||
Date: Sun, 6 Apr 2014 16:54:03 +0200
|
|
||||||
Subject: [PATCH] [xcb/xsettings] Byte order byte is at address 0
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Accoring to
|
|
||||||
http://standards.freedesktop.org\
|
|
||||||
/xsettings-spec/xsettings-spec-0.5.html
|
|
||||||
the byte order byte is address 0 (not 1).
|
|
||||||
|
|
||||||
Change-Id: I441084a7f24908dd8a504648bfc50ba2d486a586
|
|
||||||
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
|
|
||||||
---
|
|
||||||
src/plugins/platforms/xcb/qxcbxsettings.cpp | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp
|
|
||||||
index 26d95e9..17b40a4 100644
|
|
||||||
--- a/src/plugins/platforms/xcb/qxcbxsettings.cpp
|
|
||||||
+++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp
|
|
||||||
@@ -150,7 +150,7 @@ public:
|
|
||||||
{
|
|
||||||
if (xSettings.length() < 12)
|
|
||||||
return;
|
|
||||||
- char byteOrder = xSettings.at(1);
|
|
||||||
+ char byteOrder = xSettings.at(0);
|
|
||||||
if (byteOrder != LSBFirst && byteOrder != MSBFirst) {
|
|
||||||
qWarning("%s ByteOrder byte %d not 0 or 1", Q_FUNC_INFO , byteOrder);
|
|
||||||
return;
|
|
||||||
--
|
|
||||||
1.8.4.5
|
|
||||||
|
|
@ -15,7 +15,7 @@ diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platfo
|
|||||||
index dc677cd..4cd249e 100644
|
index dc677cd..4cd249e 100644
|
||||||
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
|
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
|
||||||
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
|
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
|
||||||
@@ -117,7 +117,8 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
|
@@ -118,7 +118,8 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *s
|
||||||
m_shm_info.shmseg = xcb_generate_id(xcb_connection());
|
m_shm_info.shmseg = xcb_generate_id(xcb_connection());
|
||||||
|
|
||||||
const xcb_query_extension_reply_t *shm_reply = xcb_get_extension_data(xcb_connection(), &xcb_shm_id);
|
const xcb_query_extension_reply_t *shm_reply = xcb_get_extension_data(xcb_connection(), &xcb_shm_id);
|
||||||
@ -29,7 +29,7 @@ diff --git a/src/plugins/platforms/xcb/qxcbobject.h b/src/plugins/platforms/xcb/
|
|||||||
index 354984c..2ecb5e7 100644
|
index 354984c..2ecb5e7 100644
|
||||||
--- a/src/plugins/platforms/xcb/qxcbobject.h
|
--- a/src/plugins/platforms/xcb/qxcbobject.h
|
||||||
+++ b/src/plugins/platforms/xcb/qxcbobject.h
|
+++ b/src/plugins/platforms/xcb/qxcbobject.h
|
||||||
@@ -56,6 +56,7 @@ public:
|
@@ -48,6 +48,7 @@ public:
|
||||||
|
|
||||||
xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); }
|
xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); }
|
||||||
xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); }
|
xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); }
|
||||||
|
@ -1,3 +1,54 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 16 09:17:05 UTC 2014 - hrvoje.senjan@gmail.com
|
||||||
|
|
||||||
|
- Don't override the shlib generator, but split gtk platformtheme
|
||||||
|
into platformtheme-gtk2 subpackage, the former approach is creating
|
||||||
|
problems with other dependant packages
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Dec 10 11:00:05 UTC 2014 - hrvoje.senjan@gmail.com
|
||||||
|
|
||||||
|
- Update to 5.4 Final
|
||||||
|
* For more details please see:
|
||||||
|
http://blog.qt.digia.com/blog/2014/12/10/qt-5-4-released/
|
||||||
|
and http://qt-project.org/wiki/New-Features-in-Qt-5.4
|
||||||
|
- Added Handle-SelectionClientClose-in-QXcbClipboard.patch, kde#329174
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 27 15:46:15 UTC 2014 - hrvoje.senjan@gmail.com
|
||||||
|
|
||||||
|
- Update to 5.4 RC
|
||||||
|
* For more details please see:
|
||||||
|
http://blog.qt.digia.com/blog/2014/11/27/qt-5-4-release-candidate-available/
|
||||||
|
and http://qt-project.org/wiki/New-Features-in-Qt-5.4
|
||||||
|
- New libQt5PlatformHeaders-devel subpackage
|
||||||
|
- Use one global define for gles on arm and aarch
|
||||||
|
- (Build)Require Mesa-libGLESv3-devel when building with gles
|
||||||
|
- Use system harfbuzz on 13.2 and newer
|
||||||
|
- Filter out requires obtained by dependency generators.
|
||||||
|
gtk platformtheme now won't pull in gtk libraries, so users can
|
||||||
|
have a gtk-free envirement if wanted. Those DE's that do need that
|
||||||
|
platformplugin will already have gtk present
|
||||||
|
- Drop patches merged upstream:
|
||||||
|
0001-Add-QFont-strategy-to-disable-subpixel-antialiasing.patch
|
||||||
|
0001-Allow-panels-outside-of-availableGeometry.patch
|
||||||
|
0001-QFileDialog-emit-urlsSelected-urlSelected-in-accept.patch
|
||||||
|
0001-QKdeTheme-use-system-wide-kdeglobals-as-a-fallback.patch
|
||||||
|
00010-Replace-the-const-QString-global-static-with-a-QStri.patch
|
||||||
|
00011-Use-correct-signal-name-when-disconnecting.patch
|
||||||
|
0002-Always-lock-the-DBus-dispatcher-before-dbus_connecti.patch
|
||||||
|
0002-Move-SubpixelAntialiasingType-from-QFontEngineFT-to-.patch
|
||||||
|
0002-QUrl-fromLocalFile-QString-should-lead-to-an-empty-U.patch
|
||||||
|
0003-QDBusConnection-Merge-the-dispatch-and-the-watch-and.patch
|
||||||
|
0003-QFileDialog-turn-workingDirectory-into-a-QUrl.patch
|
||||||
|
0003-Support-autohint-and-lcdfilter-fontconfig-configurat.patch
|
||||||
|
0004-GTK2-theme-should-use-GTK-configured-font-variant.patch
|
||||||
|
0004-Partially-revert-Fix-a-deadlock-introduced-by-the-ra.patch
|
||||||
|
0004-QFileDialog-implement-getOpenFileUrl-and-friends-for.patch
|
||||||
|
f1ee10f81ac18789e9a7dc715b464415ba2bc2b8.patch
|
||||||
|
libqt5-add-support-for-byte-swapping.patch
|
||||||
|
libqt5-byte-order-byte-is-address0.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Nov 11 19:34:51 UTC 2014 - hrvoje.senjan@gmail.com
|
Tue Nov 11 19:34:51 UTC 2014 - hrvoje.senjan@gmail.com
|
||||||
|
|
||||||
|
@ -19,16 +19,22 @@
|
|||||||
%define qt5_snapshot 0
|
%define qt5_snapshot 0
|
||||||
%define journald 0
|
%define journald 0
|
||||||
|
|
||||||
|
%ifarch %arm aarch64
|
||||||
|
%define gles 1
|
||||||
|
%else
|
||||||
|
%define gles 0
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: libqt5-qtbase
|
Name: libqt5-qtbase
|
||||||
Version: 5.3.2
|
Version: 5.4.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: C++ Program Library, Core Components
|
Summary: C++ Program Library, Core Components
|
||||||
License: GPL-3.0 or SUSE-LGPL-2.1-with-digia-exception-1.1
|
License: GPL-3.0 or SUSE-LGPL-2.1-with-digia-exception-1.1
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Url: http://qt.digia.com
|
Url: http://qt.digia.com
|
||||||
%define base_name libqt5
|
%define base_name libqt5
|
||||||
%define real_version 5.3.2
|
%define real_version 5.4.0
|
||||||
%define so_version 5.3.2
|
%define so_version 5.4.0
|
||||||
%define tar_version qtbase-opensource-src-%{real_version}
|
%define tar_version qtbase-opensource-src-%{real_version}
|
||||||
Source: %{tar_version}.tar.xz
|
Source: %{tar_version}.tar.xz
|
||||||
# to get mtime of file:
|
# to get mtime of file:
|
||||||
@ -52,42 +58,8 @@ Patch5: libqt5-do-not-use-shm-if-display-name-doesnt-look-local.patch
|
|||||||
Patch6: QTBUG41590.patch
|
Patch6: QTBUG41590.patch
|
||||||
# patches 1000-2000 and above from upstream 5.3 branch #
|
# patches 1000-2000 and above from upstream 5.3 branch #
|
||||||
# patches 2000-3000 and above from upstream 5.4 branch #
|
# patches 2000-3000 and above from upstream 5.4 branch #
|
||||||
# PATCH-FIX-UPSTREAM f1ee10f81ac18789e9a7dc715b464415ba2bc2b8.patch -- prefer QPA implementation in qsystemtrayicon_x11 if available
|
# PATCH-FIX-UPSTREAM Handle-SelectionClientClose-in-QXcbClipboard.patch -- kde#329174
|
||||||
Patch2000: f1ee10f81ac18789e9a7dc715b464415ba2bc2b8.patch
|
Patch2000: Handle-SelectionClientClose-in-QXcbClipboard.patch
|
||||||
# PATCH-FIX-UPSTREAM libqt5-add-support-for-byte-swapping.patch -- add support for byte swapping(bnc#866709), currently it's at the upstream dev branch
|
|
||||||
Patch2001: libqt5-add-support-for-byte-swapping.patch
|
|
||||||
# PATCH-FIX-UPSTREAM libqt5-byte-order-byte-is-address0.patch -- the byte order byte is at address 0(bnc#866709), currently it's at the upstream dev branch
|
|
||||||
Patch2002: libqt5-byte-order-byte-is-address0.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 00010-Replace-the-const-QString-global-static-with-a-QStri.patch
|
|
||||||
Patch2003: 00010-Replace-the-const-QString-global-static-with-a-QStri.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 00011-Use-correct-signal-name-when-disconnecting.patch
|
|
||||||
Patch2004: 00011-Use-correct-signal-name-when-disconnecting.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0001-QFileDialog-emit-urlsSelected-urlSelected-in-accept.patch
|
|
||||||
Patch2005: 0001-QFileDialog-emit-urlsSelected-urlSelected-in-accept.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0002-QUrl-fromLocalFile-QString-should-lead-to-an-empty-U.patch
|
|
||||||
Patch2006: 0002-QUrl-fromLocalFile-QString-should-lead-to-an-empty-U.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0003-QFileDialog-turn-workingDirectory-into-a-QUrl.patch
|
|
||||||
Patch2007: 0003-QFileDialog-turn-workingDirectory-into-a-QUrl.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0004-QFileDialog-implement-getOpenFileUrl-and-friends-for.patch
|
|
||||||
Patch2008: 0004-QFileDialog-implement-getOpenFileUrl-and-friends-for.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0001-QKdeTheme-use-system-wide-kdeglobals-as-a-fallback.patch
|
|
||||||
Patch2009: 0001-QKdeTheme-use-system-wide-kdeglobals-as-a-fallback.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0001-Add-QFont-strategy-to-disable-subpixel-antialiasing.patch
|
|
||||||
Patch2010: 0001-Add-QFont-strategy-to-disable-subpixel-antialiasing.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0002-Move-SubpixelAntialiasingType-from-QFontEngineFT-to-.patch
|
|
||||||
Patch2011: 0002-Move-SubpixelAntialiasingType-from-QFontEngineFT-to-.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0003-Support-autohint-and-lcdfilter-fontconfig-configurat.patch
|
|
||||||
Patch2012: 0003-Support-autohint-and-lcdfilter-fontconfig-configurat.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0004-GTK2-theme-should-use-GTK-configured-font-variant.patch
|
|
||||||
Patch2013: 0004-GTK2-theme-should-use-GTK-configured-font-variant.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0001-Allow-panels-outside-of-availableGeometry.patch
|
|
||||||
Patch2014: 0001-Allow-panels-outside-of-availableGeometry.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0002-Always-lock-the-DBus-dispatcher-before-dbus_connecti.patch
|
|
||||||
Patch2015: 0002-Always-lock-the-DBus-dispatcher-before-dbus_connecti.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0003-QDBusConnection-Merge-the-dispatch-and-the-watch-and.patch
|
|
||||||
Patch2016: 0003-QDBusConnection-Merge-the-dispatch-and-the-watch-and.patch
|
|
||||||
# PATCH-FIX-UPSTREAM 0004-Partially-revert-Fix-a-deadlock-introduced-by-the-ra.patch
|
|
||||||
Patch2017: 0004-Partially-revert-Fix-a-deadlock-introduced-by-the-ra.patch
|
|
||||||
BuildRequires: alsa-devel
|
BuildRequires: alsa-devel
|
||||||
BuildRequires: cups-devel
|
BuildRequires: cups-devel
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
@ -113,7 +85,8 @@ BuildRequires: pkgconfig(egl)
|
|||||||
BuildRequires: pkgconfig(fontconfig)
|
BuildRequires: pkgconfig(fontconfig)
|
||||||
BuildRequires: pkgconfig(freetype2)
|
BuildRequires: pkgconfig(freetype2)
|
||||||
BuildRequires: pkgconfig(gl)
|
BuildRequires: pkgconfig(gl)
|
||||||
%ifarch %arm aarch64
|
%if %gles
|
||||||
|
BuildRequires: Mesa-libGLESv3-devel
|
||||||
BuildRequires: pkgconfig(gbm)
|
BuildRequires: pkgconfig(gbm)
|
||||||
BuildRequires: pkgconfig(glesv2)
|
BuildRequires: pkgconfig(glesv2)
|
||||||
%endif
|
%endif
|
||||||
@ -128,7 +101,7 @@ BuildRequires: xz
|
|||||||
BuildRequires: pkgconfig(glib-2.0)
|
BuildRequires: pkgconfig(glib-2.0)
|
||||||
BuildRequires: pkgconfig(gtk+-2.0)
|
BuildRequires: pkgconfig(gtk+-2.0)
|
||||||
BuildRequires: pkgconfig(libudev)
|
BuildRequires: pkgconfig(libudev)
|
||||||
%if 0%{?suse_version} >= 1310
|
%if 0%{?suse_version} >= 1320
|
||||||
BuildRequires: pkgconfig(harfbuzz)
|
BuildRequires: pkgconfig(harfbuzz)
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: pkgconfig(ice)
|
BuildRequires: pkgconfig(ice)
|
||||||
@ -174,23 +147,6 @@ handling.
|
|||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
%patch6 -p1
|
%patch6 -p1
|
||||||
%patch2000 -p1
|
%patch2000 -p1
|
||||||
%patch2001 -p1
|
|
||||||
%patch2002 -p1
|
|
||||||
%patch2003 -p1
|
|
||||||
%patch2004 -p1
|
|
||||||
%patch2005 -p1
|
|
||||||
%patch2006 -p1
|
|
||||||
%patch2007 -p1
|
|
||||||
%patch2008 -p1
|
|
||||||
%patch2009 -p1
|
|
||||||
%patch2010 -p1
|
|
||||||
%patch2011 -p1
|
|
||||||
%patch2012 -p1
|
|
||||||
%patch2013 -p1
|
|
||||||
%patch2014 -p1
|
|
||||||
%patch2015 -p1
|
|
||||||
%patch2016 -p1
|
|
||||||
%patch2017 -p1
|
|
||||||
|
|
||||||
# be sure not to use them
|
# be sure not to use them
|
||||||
rm -r src/3rdparty/{libjpeg,freetype,libpng,zlib}
|
rm -r src/3rdparty/{libjpeg,freetype,libpng,zlib}
|
||||||
@ -208,6 +164,7 @@ Requires: libQt5DBus-devel = %{version}
|
|||||||
Requires: libQt5Gui-devel = %{version}
|
Requires: libQt5Gui-devel = %{version}
|
||||||
Requires: libQt5Network-devel = %{version}
|
Requires: libQt5Network-devel = %{version}
|
||||||
Requires: libQt5OpenGL-devel = %{version}
|
Requires: libQt5OpenGL-devel = %{version}
|
||||||
|
Requires: libQt5PlatformHeaders-devel = %{version}
|
||||||
Requires: libQt5PrintSupport-devel = %{version}
|
Requires: libQt5PrintSupport-devel = %{version}
|
||||||
Requires: libQt5Sql-devel = %{version}
|
Requires: libQt5Sql-devel = %{version}
|
||||||
Requires: libQt5Test-devel = %{version}
|
Requires: libQt5Test-devel = %{version}
|
||||||
@ -340,7 +297,8 @@ Requires: libQt5Core-devel = %{version}
|
|||||||
Requires: libQt5Gui-devel = %{version}
|
Requires: libQt5Gui-devel = %{version}
|
||||||
Requires: libQt5OpenGL5 = %{version}
|
Requires: libQt5OpenGL5 = %{version}
|
||||||
Requires: libQt5Widgets-devel = %{version}
|
Requires: libQt5Widgets-devel = %{version}
|
||||||
%ifarch %arm aarch64
|
%if %gles
|
||||||
|
Requires: Mesa-libGLESv3-devel
|
||||||
Requires: pkgconfig(glesv2)
|
Requires: pkgconfig(glesv2)
|
||||||
%else
|
%else
|
||||||
Requires: pkgconfig(gl)
|
Requires: pkgconfig(gl)
|
||||||
@ -515,12 +473,22 @@ Recommends: libqt5-qtimageformats = %{version}
|
|||||||
%description -n libQt5Gui5
|
%description -n libQt5Gui5
|
||||||
Qt 5 libraries which are depending on X11.
|
Qt 5 libraries which are depending on X11.
|
||||||
|
|
||||||
|
%package platformtheme-gtk2
|
||||||
|
Summary: Qt 5 gtk2 plugin
|
||||||
|
Group: Development/Libraries/C and C++
|
||||||
|
Supplements: packageand(libQt5Gui5:libgtk-2_0-0)
|
||||||
|
|
||||||
|
%description platformtheme-gtk2
|
||||||
|
Qt 5 plugin for better integration with gtk2-based desktop enviroments.
|
||||||
|
|
||||||
%package -n libQt5Gui-devel
|
%package -n libQt5Gui-devel
|
||||||
Summary: Qt 5 GUI related libraries - development files
|
Summary: Qt 5 GUI related libraries - development files
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Requires: libQt5Core-devel = %{version}
|
Requires: libQt5Core-devel = %{version}
|
||||||
Requires: libQt5Gui5 = %{version}
|
Requires: libQt5Gui5 = %{version}
|
||||||
%ifarch %arm aarch64
|
%if %gles
|
||||||
|
Requires: Mesa-libGLESv3-devel
|
||||||
|
Requires: pkgconfig(gbm)
|
||||||
Requires: pkgconfig(glesv2)
|
Requires: pkgconfig(glesv2)
|
||||||
%else
|
%else
|
||||||
Requires: pkgconfig(gl)
|
Requires: pkgconfig(gl)
|
||||||
@ -588,6 +556,7 @@ Qt 5 tool used by Qt Developers to generate documentation for software projects.
|
|||||||
Summary: Non-ABI stable experimental API
|
Summary: Non-ABI stable experimental API
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
Requires: %{name}-devel = %{version}
|
||||||
Requires: libQt5Core-private-headers-devel = %{version}
|
Requires: libQt5Core-private-headers-devel = %{version}
|
||||||
Requires: libQt5DBus-private-headers-devel = %{version}
|
Requires: libQt5DBus-private-headers-devel = %{version}
|
||||||
Requires: libQt5Gui-private-headers-devel = %{version}
|
Requires: libQt5Gui-private-headers-devel = %{version}
|
||||||
@ -629,6 +598,7 @@ Summary: Qt PlatformSupport module
|
|||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Requires: libQt5Core-devel = %{version}
|
Requires: libQt5Core-devel = %{version}
|
||||||
Requires: libQt5Gui-devel = %{version}
|
Requires: libQt5Gui-devel = %{version}
|
||||||
|
Requires: libQt5PlatformHeaders-devel = %{version}
|
||||||
# List the below ones manually - they are private, but this is a static lib
|
# List the below ones manually - they are private, but this is a static lib
|
||||||
Requires: pkgconfig(Qt5DBus)
|
Requires: pkgconfig(Qt5DBus)
|
||||||
Requires: pkgconfig(egl)
|
Requires: pkgconfig(egl)
|
||||||
@ -656,6 +626,24 @@ Requires: libQt5PlatformSupport-devel-static = %{version}
|
|||||||
%description -n libQt5PlatformSupport-private-headers-devel
|
%description -n libQt5PlatformSupport-private-headers-devel
|
||||||
Qt 5 PlatformSupport Library - Non-ABI stable development files.
|
Qt 5 PlatformSupport Library - Non-ABI stable development files.
|
||||||
|
|
||||||
|
%package -n libQt5PlatformHeaders-devel
|
||||||
|
Summary: Qt 5 PlatformHeaders
|
||||||
|
Group: Development/Libraries/X11
|
||||||
|
# NOTE this needs to be checked on every update - package provides only a low number of headers, so check which 3rd party, or other qtbase includes are used
|
||||||
|
Requires: libQt5Core-devel = %{version}
|
||||||
|
Requires: libQt5Gui-devel = %{version}
|
||||||
|
Requires: pkgconfig(egl)
|
||||||
|
Requires: pkgconfig(x11)
|
||||||
|
%if %gles
|
||||||
|
Requires: Mesa-libGLESv3-devel
|
||||||
|
Requires: pkgconfig(glesv2)
|
||||||
|
%else
|
||||||
|
Requires: pkgconfig(gl)
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description -n libQt5PlatformHeaders-devel
|
||||||
|
Qt 5 PlatformHeaders.
|
||||||
|
|
||||||
%package examples
|
%package examples
|
||||||
Summary: Qt5 base examples
|
Summary: Qt5 base examples
|
||||||
Group: Development/Libraries/X11
|
Group: Development/Libraries/X11
|
||||||
@ -736,7 +724,7 @@ echo yes | ./configure $platform \
|
|||||||
-system-libjpeg \
|
-system-libjpeg \
|
||||||
-openssl-linked \
|
-openssl-linked \
|
||||||
-system-libpng \
|
-system-libpng \
|
||||||
%if 0%{?suse_version} >= 1310
|
%if 0%{?suse_version} >= 1320
|
||||||
-system-harfbuzz \
|
-system-harfbuzz \
|
||||||
%endif
|
%endif
|
||||||
-fontconfig \
|
-fontconfig \
|
||||||
@ -759,7 +747,7 @@ echo yes | ./configure $platform \
|
|||||||
-xcb \
|
-xcb \
|
||||||
-egl \
|
-egl \
|
||||||
-eglfs \
|
-eglfs \
|
||||||
%ifarch %arm aarch64
|
%if %gles
|
||||||
-eglfs -kms \
|
-eglfs -kms \
|
||||||
-opengl es2 \
|
-opengl es2 \
|
||||||
%else
|
%else
|
||||||
@ -1035,7 +1023,6 @@ done
|
|||||||
%defattr(-,root,root,755)
|
%defattr(-,root,root,755)
|
||||||
%doc *.txt LICENSE.*
|
%doc *.txt LICENSE.*
|
||||||
%{libqt5_libdir}/libQt5Widgets.so.*
|
%{libqt5_libdir}/libQt5Widgets.so.*
|
||||||
%{libqt5_plugindir}/accessible
|
|
||||||
|
|
||||||
%files -n libQt5Widgets-devel
|
%files -n libQt5Widgets-devel
|
||||||
%defattr(-,root,root,755)
|
%defattr(-,root,root,755)
|
||||||
@ -1058,7 +1045,12 @@ done
|
|||||||
%{libqt5_plugindir}/imageformats
|
%{libqt5_plugindir}/imageformats
|
||||||
%{libqt5_plugindir}/platforminputcontexts
|
%{libqt5_plugindir}/platforminputcontexts
|
||||||
%{libqt5_plugindir}/platforms
|
%{libqt5_plugindir}/platforms
|
||||||
%{libqt5_plugindir}/platformthemes
|
|
||||||
|
%files platformtheme-gtk2
|
||||||
|
%defattr(-,root,root,755)
|
||||||
|
%doc *.txt LICENSE.*
|
||||||
|
%dir %{libqt5_plugindir}/platformthemes
|
||||||
|
%{libqt5_plugindir}/platformthemes/libqgtk2.so
|
||||||
|
|
||||||
%files -n libQt5Gui-devel
|
%files -n libQt5Gui-devel
|
||||||
%defattr(-,root,root,755)
|
%defattr(-,root,root,755)
|
||||||
@ -1196,6 +1188,11 @@ done
|
|||||||
%doc *.txt LICENSE.*
|
%doc *.txt LICENSE.*
|
||||||
%{libqt5_includedir}/QtWidgets/%{so_version}/
|
%{libqt5_includedir}/QtWidgets/%{so_version}/
|
||||||
|
|
||||||
|
%files -n libQt5PlatformHeaders-devel
|
||||||
|
%defattr(-,root,root,755)
|
||||||
|
%doc *.txt LICENSE.*
|
||||||
|
%{libqt5_includedir}/QtPlatformHeaders/
|
||||||
|
|
||||||
%files examples
|
%files examples
|
||||||
%defattr(-,root,root,755)
|
%defattr(-,root,root,755)
|
||||||
%doc *.txt LICENSE.*
|
%doc *.txt LICENSE.*
|
||||||
|
@ -2,10 +2,11 @@ diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwi
|
|||||||
index 35a526e..d417e41 100644
|
index 35a526e..d417e41 100644
|
||||||
--- a/src/widgets/kernel/qwidgetwindow.cpp
|
--- a/src/widgets/kernel/qwidgetwindow.cpp
|
||||||
+++ b/src/widgets/kernel/qwidgetwindow.cpp
|
+++ b/src/widgets/kernel/qwidgetwindow.cpp
|
||||||
@@ -551,6 +551,13 @@ void QWidgetWindow::updateGeometry()
|
@@ -573,6 +573,14 @@ bool QWidgetWindow::updatePos()
|
||||||
|
void QWidgetWindow::updateMargins()
|
||||||
|
{
|
||||||
const QMargins margins = frameMargins();
|
const QMargins margins = frameMargins();
|
||||||
|
+
|
||||||
+ if (geometry().x() != m_widget->data->crect.x() ||
|
+ if (geometry().x() != m_widget->data->crect.x() ||
|
||||||
+ geometry().y() != m_widget->data->crect.y())
|
+ geometry().y() != m_widget->data->crect.y())
|
||||||
+ m_widget->setAttribute(Qt::WA_Moved);
|
+ m_widget->setAttribute(Qt::WA_Moved);
|
||||||
@ -13,6 +14,6 @@ index 35a526e..d417e41 100644
|
|||||||
+ geometry().height() != m_widget->data->crect.height())
|
+ geometry().height() != m_widget->data->crect.height())
|
||||||
+ m_widget->setAttribute(Qt::WA_Resized);
|
+ m_widget->setAttribute(Qt::WA_Resized);
|
||||||
+
|
+
|
||||||
m_widget->data->crect = geometry();
|
|
||||||
QTLWExtra *te = m_widget->d_func()->topData();
|
QTLWExtra *te = m_widget->d_func()->topData();
|
||||||
te->posIncludesFrame= false;
|
te->posIncludesFrame= false;
|
||||||
|
te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:9a16095ac46dae99d6ddab8bc07065fbe1c36501ed194a3191d07347d7826cb8
|
|
||||||
size 46694044
|
|
3
qtbase-opensource-src-5.4.0.tar.xz
Normal file
3
qtbase-opensource-src-5.4.0.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:daea240ba5e77bc2d78ec21a2cb664eed83b3d4ad409b6277a6f7d4c0c8e91d1
|
||||||
|
size 46109688
|
Loading…
Reference in New Issue
Block a user