Merge lp:~charlesk/indicator-applet/fix-944220 into lp:indicator-applet/0.5

Proposed by Charles Kerr
Status: Merged
Approved by: Ted Gould
Approved revision: 397
Merge reported by: Charles Kerr
Merged at revision: not available
Proposed branch: lp:~charlesk/indicator-applet/fix-944220
Merge into: lp:indicator-applet/0.5
Diff against target: 150 lines (+0/-131)
2 files modified
src/eggaccelerators.c (+0/-128)
src/eggaccelerators.h (+0/-3)
To merge this branch: bzr merge lp:~charlesk/indicator-applet/fix-944220
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+95741@code.launchpad.net

Description of the change

I agree with Ted's assessment that the warnings in Bug #944220 are a low priority.

Happily, since the function generating these warnings is completely unused, we can fix the warnings and avoid the need for testing by just removing the function. :)

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

On Sat, 2012-03-03 at 18:43 +0000, charles wrote:
> I agree with Ted's assessment that the warnings in Bug #944220 are a
> low priority.
>
> Happily, since the function generating these warnings is completely
> unused, we can fix the warnings and avoid the need for testing by just
> removing the function. :)

Heh, I hadn't noticed that! Awesome!

  review approve
  status approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/eggaccelerators.c'
2--- src/eggaccelerators.c 2011-08-01 21:33:24 +0000
3+++ src/eggaccelerators.c 2012-03-03 18:42:18 +0000
4@@ -331,134 +331,6 @@
5 }
6
7
8-/**
9- * egg_virtual_accelerator_name:
10- * @accelerator_key: accelerator keyval
11- * @accelerator_mods: accelerator modifier mask
12- * @returns: a newly-allocated accelerator name
13- *
14- * Converts an accelerator keyval and modifier mask
15- * into a string parseable by egg_accelerator_parse_virtual().
16- * For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,
17- * this function returns "<Control>q".
18- *
19- * The caller of this function must free the returned string.
20- */
21-gchar*
22-egg_virtual_accelerator_name (guint accelerator_key,
23- EggVirtualModifierType accelerator_mods)
24-{
25- static const gchar text_release[] = "<Release>";
26- static const gchar text_shift[] = "<Shift>";
27- static const gchar text_control[] = "<Control>";
28- static const gchar text_mod1[] = "<Alt>";
29- static const gchar text_mod2[] = "<Mod2>";
30- static const gchar text_mod3[] = "<Mod3>";
31- static const gchar text_mod4[] = "<Mod4>";
32- static const gchar text_mod5[] = "<Mod5>";
33- static const gchar text_meta[] = "<Meta>";
34- static const gchar text_super[] = "<Super>";
35- static const gchar text_hyper[] = "<Hyper>";
36- guint l;
37- gchar *keyval_name;
38- gchar *accelerator;
39-
40- accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;
41-
42- keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));
43- if (!keyval_name)
44- keyval_name = "";
45-
46- l = 0;
47- if (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)
48- l += sizeof (text_release) - 1;
49- if (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)
50- l += sizeof (text_shift) - 1;
51- if (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)
52- l += sizeof (text_control) - 1;
53- if (accelerator_mods & EGG_VIRTUAL_ALT_MASK)
54- l += sizeof (text_mod1) - 1;
55- if (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)
56- l += sizeof (text_mod2) - 1;
57- if (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)
58- l += sizeof (text_mod3) - 1;
59- if (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)
60- l += sizeof (text_mod4) - 1;
61- if (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)
62- l += sizeof (text_mod5) - 1;
63- if (accelerator_mods & EGG_VIRTUAL_META_MASK)
64- l += sizeof (text_meta) - 1;
65- if (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)
66- l += sizeof (text_hyper) - 1;
67- if (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)
68- l += sizeof (text_super) - 1;
69- l += strlen (keyval_name);
70-
71- accelerator = g_new (gchar, l + 1);
72-
73- l = 0;
74- accelerator[l] = 0;
75- if (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)
76- {
77- strcpy (accelerator + l, text_release);
78- l += sizeof (text_release) - 1;
79- }
80- if (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)
81- {
82- strcpy (accelerator + l, text_shift);
83- l += sizeof (text_shift) - 1;
84- }
85- if (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)
86- {
87- strcpy (accelerator + l, text_control);
88- l += sizeof (text_control) - 1;
89- }
90- if (accelerator_mods & EGG_VIRTUAL_ALT_MASK)
91- {
92- strcpy (accelerator + l, text_mod1);
93- l += sizeof (text_mod1) - 1;
94- }
95- if (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)
96- {
97- strcpy (accelerator + l, text_mod2);
98- l += sizeof (text_mod2) - 1;
99- }
100- if (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)
101- {
102- strcpy (accelerator + l, text_mod3);
103- l += sizeof (text_mod3) - 1;
104- }
105- if (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)
106- {
107- strcpy (accelerator + l, text_mod4);
108- l += sizeof (text_mod4) - 1;
109- }
110- if (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)
111- {
112- strcpy (accelerator + l, text_mod5);
113- l += sizeof (text_mod5) - 1;
114- }
115- if (accelerator_mods & EGG_VIRTUAL_META_MASK)
116- {
117- strcpy (accelerator + l, text_meta);
118- l += sizeof (text_meta) - 1;
119- }
120- if (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)
121- {
122- strcpy (accelerator + l, text_hyper);
123- l += sizeof (text_hyper) - 1;
124- }
125- if (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)
126- {
127- strcpy (accelerator + l, text_super);
128- l += sizeof (text_super) - 1;
129- }
130-
131- strcpy (accelerator + l, keyval_name);
132-
133- return accelerator;
134-}
135-
136 void
137 egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,
138 EggVirtualModifierType virtual_mods,
139
140=== modified file 'src/eggaccelerators.h'
141--- src/eggaccelerators.h 2011-08-01 21:33:24 +0000
142+++ src/eggaccelerators.h 2012-03-03 18:42:18 +0000
143@@ -77,9 +77,6 @@
144 GdkModifierType concrete_mods,
145 EggVirtualModifierType *virtual_mods);
146
147-gchar* egg_virtual_accelerator_name (guint accelerator_key,
148- EggVirtualModifierType accelerator_mods);
149-
150 G_END_DECLS
151
152

Subscribers

People subscribed via source and target branches