Merge lp:~fboucault/ubuntu-ui-toolkit/gicon_no_qpixmap into lp:ubuntu-ui-toolkit

Proposed by Florian Boucault on 2013-07-09
Status: Merged
Approved by: Florian Boucault on 2013-07-09
Approved revision: 596
Merged at revision: 599
Proposed branch: lp:~fboucault/ubuntu-ui-toolkit/gicon_no_qpixmap
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 40 lines (+5/-5)
1 file modified
modules/Ubuntu/Components/plugin/giconprovider.cpp (+5/-5)
To merge this branch: bzr merge lp:~fboucault/ubuntu-ui-toolkit/gicon_no_qpixmap
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2013-07-09
Ubuntu SDK team 2013-07-09 Pending
Review via email: mp+173734@code.launchpad.net

Commit message

GIconProvider: avoid using QPixmap which is not re-entrant. Fixes crashes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/plugin/giconprovider.cpp'
2--- modules/Ubuntu/Components/plugin/giconprovider.cpp 2012-11-28 13:21:48 +0000
3+++ modules/Ubuntu/Components/plugin/giconprovider.cpp 2013-07-09 14:26:22 +0000
4@@ -59,7 +59,7 @@
5
6 QImage GIconProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
7 {
8- QPixmap result;
9+ QImage result;
10 QByteArray utf8Name = QUrl::fromPercentEncoding(id.toUtf8()).toUtf8();
11 GError *error = NULL;
12 GIcon *icon = g_icon_new_for_string(utf8Name.data(), &error);
13@@ -73,9 +73,9 @@
14 QIcon themedIcon = getThemedIcon(reinterpret_cast<GThemedIcon*>(icon));
15 if (!themedIcon.isNull()) {
16 if (requestedSize.isValid()) {
17- result = themedIcon.pixmap(requestedSize);
18+ result = themedIcon.pixmap(requestedSize).toImage();
19 } else {
20- result = themedIcon.pixmap(themedIcon.availableSizes().last());
21+ result = themedIcon.pixmap(themedIcon.availableSizes().last()).toImage();
22 }
23 } else {
24 qDebug() << "Fail to load themed icon for:" << id;
25@@ -83,7 +83,7 @@
26 } else if (G_IS_FILE_ICON(icon)) {
27 gchar *iconName = g_icon_to_string(icon);
28 if (QFile::exists(iconName)) {
29- result = QPixmap(iconName);
30+ result.load(iconName);
31 if (requestedSize.isValid()) {
32 result = result.scaled(requestedSize);
33 }
34@@ -98,5 +98,5 @@
35
36 g_object_unref(icon);
37 *size = result.size();
38- return result.toImage();
39+ return result;
40 }

Subscribers

People subscribed via source and target branches

to status/vote changes: