Merge lp:~mitya57/kubuntu-packaging/qt-lp1180067 into lp:~kubuntu-packagers/kubuntu-packaging/qt

Proposed by Dmitry Shachnev
Status: Merged
Merged at revision: 362
Proposed branch: lp:~mitya57/kubuntu-packaging/qt-lp1180067
Merge into: lp:~kubuntu-packagers/kubuntu-packaging/qt
Diff against target: 103 lines (+80/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/kubuntu_42_fix_icon_themes.diff (+71/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~mitya57/kubuntu-packaging/qt-lp1180067
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Approve
Ubuntu branches Pending
Review via email: mp+164629@code.launchpad.net

Description of the change

* debian/patches/kubuntu_42_fix_icon_themes.diff:
  fix icon themes not working on a default Ubuntu install by using
  GtkSettings where appropriate (LP: #1180067).

This was forwarded upstream as https://codereview.qt-project.org/56458 (after dfaure's pre-approval on IRC), and this is already applied in Qt 5 (though the code is in a different place).

It will be nice if someone sponsored this to both saucy and raring-proposed.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

lgtm. Test building.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

verified with qt4/demos/textedit app.

review: Approve
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

@Dmitrijs: can we get this uploaded to raring-proposed before saucy gets fixed? I'm getting tons of bug reports that icons are not working in ReText because of this bug...

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Before uploading this as an SRU for Raring, please update the bug description as per:
https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Done.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-03-27 00:02:17 +0000
3+++ debian/changelog 2013-05-19 15:27:26 +0000
4@@ -1,3 +1,11 @@
5+qt4-x11 (4:4.8.4+dfsg-0ubuntu10) UNRELEASED; urgency=low
6+
7+ * debian/patches/kubuntu_42_fix_icon_themes.diff:
8+ fix icon themes not working on a default Ubuntu install by using
9+ GtkSettings where appropriate (LP: #1180067).
10+
11+ -- Dmitry Shachnev <mitya57@ubuntu.com> Sun, 19 May 2013 19:18:58 +0400
12+
13 qt4-x11 (4:4.8.4+dfsg-0ubuntu9) raring; urgency=low
14
15 * Fix moc tripping over BOOST_JOIN. (LP: #1119656)
16
17=== added file 'debian/patches/kubuntu_42_fix_icon_themes.diff'
18--- debian/patches/kubuntu_42_fix_icon_themes.diff 1970-01-01 00:00:00 +0000
19+++ debian/patches/kubuntu_42_fix_icon_themes.diff 2013-05-19 15:27:26 +0000
20@@ -0,0 +1,71 @@
21+Description: fix icon themes not working on default Ubuntu install
22+ On Ubuntu, /desktop/gnome/interface/icon_theme is no longer set by
23+ default, so systemIconThemeName() returns "gnome" as a fallback
24+ value. However, "gnome" icon theme is unusable unless
25+ "gnome-icon-theme-full" package is installed (which is not installed
26+ by default).
27+ .
28+ This patch makes systemIconThemeName() use GtkSettings on all non-KDE
29+ environments. This way is more reliable and returns correct theme
30+ name ("ubuntu-mono-dark") on the default Ubuntu install.
31+Author: Dmitry Shachnev <mitya57@ubuntu.com>
32+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1180067
33+Last-Update: 2013-05-19
34+Forwarded: yes
35+
36+--- a/src/gui/kernel/qguiplatformplugin.cpp
37++++ b/src/gui/kernel/qguiplatformplugin.cpp
38+@@ -204,10 +204,12 @@ QString QGuiPlatformPlugin::systemIconThemeName()
39+ QString result;
40+ #ifdef Q_WS_X11
41+ if (X11->desktopEnvironment == DE_GNOME) {
42+- result = QString::fromLatin1("gnome");
43+ #ifndef QT_NO_STYLE_GTK
44+- result = QGtkStylePrivate::getGConfString(QLatin1String("/desktop/gnome/interface/icon_theme"), result);
45++ result = QGtkStylePrivate::getIconThemeName();
46+ #endif
47++ if (result.isEmpty()) {
48++ result = QString::fromLatin1("gnome");
49++ }
50+ } else if (X11->desktopEnvironment == DE_KDE) {
51+ result = X11->desktopVersion >= 4 ? QString::fromLatin1("oxygen") : QString::fromLatin1("crystalsvg");
52+ QSettings settings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
53+--- a/src/gui/styles/qgtkstyle_p.cpp
54++++ b/src/gui/styles/qgtkstyle_p.cpp
55+@@ -686,6 +686,26 @@ QString QGtkStylePrivate::getThemeName()
56+ return themeName;
57+ }
58+
59++QString QGtkStylePrivate::getIconThemeName() {
60++ if (!gtk_settings_get_default) {
61++ // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
62++ QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
63++ libgtk.setLoadHints(QLibrary::ImprovedSearchHeuristics);
64++ gtk_init = (Ptr_gtk_init)libgtk.resolve("gtk_init");
65++ gtk_settings_get_default = (Ptr_gtk_settings_get_default)libgtk.resolve("gtk_settings_get_default");
66++ }
67++ if (!gtk_settings_get_default) {
68++ return QString();
69++ }
70++ gtk_init(NULL, NULL);
71++ GtkSettings *settings = gtk_settings_get_default();
72++ gchararray value;
73++ g_object_get(settings, "gtk-icon-theme-name", &value, NULL);
74++ QString result = QString::fromUtf8(value);
75++ g_free(value);
76++ return result;
77++}
78++
79+ // Get size of the arrow controls in a GtkSpinButton
80+ int QGtkStylePrivate::getSpinboxArrowSize() const
81+ {
82+--- a/src/gui/styles/qgtkstyle_p.h
83++++ b/src/gui/styles/qgtkstyle_p.h
84+@@ -339,6 +339,7 @@ public:
85+ static QString getGConfString(const QString &key, const QString &fallback = QString());
86+
87+ static QString getThemeName();
88++ static QString getIconThemeName();
89+ virtual int getSpinboxArrowSize() const;
90+
91+ static void setupGtkFileChooser(GtkWidget* gtkFileChooser, QWidget *parent,
92
93=== modified file 'debian/patches/series'
94--- debian/patches/series 2013-03-27 00:02:06 +0000
95+++ debian/patches/series 2013-05-19 15:27:26 +0000
96@@ -58,6 +58,7 @@
97 kubuntu_39_fix_medium_font.diff
98 kubuntu_40_disable_neon.patch
99 kubuntu_41_remove_gtk_theme_check.diff
100+kubuntu_42_fix_icon_themes.diff
101 kubuntu_93_disable_overlay_scrollbars.diff
102 kubuntu_94_xinput_valuators_fix.diff
103 kubuntu_95_qt_disable_bounce.diff

Subscribers

People subscribed via source and target branches