Merge lp:~cszikszoy/docky/wm-cmdline-suffix into lp:docky

Proposed by Chris S.
Status: Merged
Merged at revision: not available
Proposed branch: lp:~cszikszoy/docky/wm-cmdline-suffix
Merge into: lp:docky
Diff against target: 39 lines
1 file modified
Docky.Windowing/Windowing/WindowMatcher.cs (+20/-3)
To merge this branch: bzr merge lp:~cszikszoy/docky/wm-cmdline-suffix
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+14076@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Docky.Windowing/Windowing/WindowMatcher.cs'
2--- Docky.Windowing/Windowing/WindowMatcher.cs 2009-10-17 05:55:41 +0000
3+++ Docky.Windowing/Windowing/WindowMatcher.cs 2009-10-28 08:45:26 +0000
4@@ -99,6 +99,12 @@
5 }
6 }
7
8+ static IEnumerable<string> SuffixStrings {
9+ get {
10+ yield return "-bin";
11+ }
12+ }
13+
14 Dictionary<Wnck.Window, List<string>> window_to_desktop_files;
15 Dictionary<string, List<string>> exec_to_desktop_files;
16 List<Regex> prefix_filters;
17@@ -235,9 +241,20 @@
18 }
19 }
20
21- if (command_line != null && exec_to_desktop_files.ContainsKey (command_line[0])) {
22- foreach (string s in exec_to_desktop_files[command_line[0]])
23- yield return s;
24+ if (command_line != null) {
25+ string cmd = command_line[0];
26+ foreach (string s in SuffixStrings) {
27+ if (!cmd.EndsWith (s))
28+ continue;
29+ if (exec_to_desktop_files.ContainsKey (cmd.Remove (cmd.LastIndexOf (s), s.Length))) {
30+ cmd = cmd.Remove (cmd.LastIndexOf (s), s.Length);
31+ break;
32+ }
33+ }
34+ if (exec_to_desktop_files.ContainsKey (cmd)) {
35+ foreach (string s in exec_to_desktop_files[cmd])
36+ yield return s;
37+ }
38 yield break;
39 }
40

Subscribers

People subscribed via source and target branches

to status/vote changes: