From 32cff2880506b0c2249ad38c50e15331d22ace80 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Mon, 28 Nov 2011 11:55:29 -0500 Subject: [PATCH] Fix a valac warning --- ui/gtk3/keybindingmanager.vala | 2 +- ui/gtk3/panel.vala | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ui/gtk3/keybindingmanager.vala b/ui/gtk3/keybindingmanager.vala index ebb9d64..dd49397 100644 --- a/ui/gtk3/keybindingmanager.vala +++ b/ui/gtk3/keybindingmanager.vala @@ -141,7 +141,7 @@ public class KeybindingManager : GLib.Object { Gdk.ModifierType.LOCK_MASK }; foreach (var mask in masks) { - if ((binding_mask & mask) != 0) + if ((binding_mask & mask) == mask) return mask; } return 0; diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala index 9cb856a..d87de2f 100644 --- a/ui/gtk3/panel.vala +++ b/ui/gtk3/panel.vala @@ -106,14 +106,14 @@ class Panel : IBus.PanelService { private void update_engines() { Variant variant = m_config.get_value("general", "preload_engines"); + string[] engine_names; + if (variant != null) - m_engines = m_bus.get_engines_by_names(variant.get_strv()); + engine_names = variant.dup_strv(); else - m_engines = m_bus.get_engines_by_names({ - "xkb:us:eng", - "pinyin", - "anthy" - }); + engine_names = {"xkb:us:eng", "pinyin", "anthy"}; + + m_engines = m_bus.get_engines_by_names(engine_names); m_ime_menu = null; } -- 2.7.4