aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-10-28 17:30:07 -0700
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-10-28 17:30:07 -0700
commit287a91fa3002f1571982fcc6a507c2ea4106e053 (patch)
tree3b038c4ba9a7af866f025c5d92e701de926e74e2
parent642b8860224faced6696fc182c0a487e83b5f121 (diff)
downloadayatana-indicator-sound-287a91fa3002f1571982fcc6a507c2ea4106e053.tar.gz
ayatana-indicator-sound-287a91fa3002f1571982fcc6a507c2ea4106e053.tar.bz2
ayatana-indicator-sound-287a91fa3002f1571982fcc6a507c2ea4106e053.zip
Stop using g_icon_serialize() directly
Vala 0.20 now comes with a gio-2.0.vapi that has Icon.serialize().
-rw-r--r--src/service.vala2
-rw-r--r--src/sound-menu.vala9
2 files changed, 4 insertions, 7 deletions
diff --git a/src/service.vala b/src/service.vala
index aa992ff..7dc6824 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -140,7 +140,7 @@ public class IndicatorSound.Service {
static Variant serialize_themed_icon (string icon_name)
{
var icon = new ThemedIcon.with_default_fallbacks (icon_name);
- return g_icon_serialize (icon);
+ return icon.serialize ();
}
void update_root_icon () {
diff --git a/src/sound-menu.vala b/src/sound-menu.vala
index f3f4fd9..5a10596 100644
--- a/src/sound-menu.vala
+++ b/src/sound-menu.vala
@@ -17,9 +17,6 @@
* Lars Uebernickel <lars.uebernickel@canonical.com>
*/
-/* Icon.serialize() is not yet in gio-2.0.vapi; remove this when it is */
-extern Variant? g_icon_serialize (Icon icon);
-
class SoundMenu: Object
{
public enum DisplayFlags {
@@ -150,7 +147,7 @@ class SoundMenu: Object
var player_item = new MenuItem (player.name, "indicator." + player.id);
player_item.set_attribute ("x-canonical-type", "s", "com.canonical.unity.media-player");
if (icon != null)
- player_item.set_attribute_value ("icon", g_icon_serialize (icon));
+ player_item.set_attribute_value ("icon", icon.serialize ());
section.append_item (player_item);
var playback_item = new MenuItem (null, null);
@@ -211,8 +208,8 @@ class SoundMenu: Object
var slider = new MenuItem (null, action);
slider.set_attribute ("x-canonical-type", "s", "com.canonical.unity.slider");
- slider.set_attribute_value ("min-icon", g_icon_serialize (min_icon));
- slider.set_attribute_value ("max-icon", g_icon_serialize (max_icon));
+ slider.set_attribute_value ("min-icon", min_icon.serialize ());
+ slider.set_attribute_value ("max-icon", max_icon.serialize ());
slider.set_attribute ("min-value", "d", min);
slider.set_attribute ("max-value", "d", max);
slider.set_attribute ("step", "d", step);