Merge lp:~fboucault/unity-2d/launcher_device_icons into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Approved by: Aurélien Gâteau
Approved revision: 551
Merged at revision: 558
Proposed branch: lp:~fboucault/unity-2d/launcher_device_icons
Merge into: lp:unity-2d/3.0
Diff against target: 28 lines (+10/-1)
1 file modified
launcher/UnityApplications/launcherdevice.cpp (+10/-1)
To merge this branch: bzr merge lp:~fboucault/unity-2d/launcher_device_icons
Reviewer Review Type Date Requested Status
Aurélien Gâteau (community) Approve
Review via email: mp+59377@code.launchpad.net

Description of the change

[launcher] Use appropriate icon for devices depending on their type (instead of always showing a USB icon).

To post a comment you must log in.
Revision history for this message
Aurélien Gâteau (agateau) wrote :

Looks good, but code could be simplified by taking advantage of the GScopedPointer classes. Also you can return QString(), it is a tiny bit more efficient than QString("").

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

Suggestions have been applied.

551. By Florian Boucault

Simplified code using GScopedPointer.

Revision history for this message
Aurélien Gâteau (agateau) wrote :

Works well (finally found a device to check!)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'launcher/UnityApplications/launcherdevice.cpp'
--- launcher/UnityApplications/launcherdevice.cpp 2011-04-28 13:09:25 +0000
+++ launcher/UnityApplications/launcherdevice.cpp 2011-04-28 18:56:06 +0000
@@ -20,6 +20,7 @@
20#include "launcherdevice.h"20#include "launcherdevice.h"
21#include "launchermenu.h"21#include "launchermenu.h"
2222
23#include <gscopedpointer.h>
23#include "config.h"24#include "config.h"
2425
25#include <QDebug>26#include <QDebug>
@@ -93,7 +94,15 @@
93QString94QString
94LauncherDevice::icon() const95LauncherDevice::icon() const
95{96{
96 return QString(unity2dDirectory() + "/launcher/artwork/devices.png");97 if (m_volume != NULL) {
98 GObjectPointer icon((GObject*)g_volume_get_icon(m_volume));
99 if (!icon.isNull()) {
100 GCharPointer iconName(g_icon_to_string((GIcon*)icon.data()));
101 return QString::fromUtf8(iconName.data());
102 }
103 }
104
105 return QString();
97}106}
98107
99bool108bool

Subscribers

People subscribed via source and target branches