~and471/+junk/do-with-docky

« back to all changes in this revision

Viewing changes to Do.Platform.Linux/src/Do.Universe/ApplicationItem.cs

  • Committer: rugby471 at gmail
  • Date: 2010-10-15 16:08:38 UTC
  • Revision ID: rugby471@gmail.com-20101015160838-z9m3utbf7bxzb5ty
reverted to before docky removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
                        if (path == null) throw new ArgumentNullException ("path");
52
52
 
53
 
                        if (Instances.ContainsKey (key)) {
54
 
                                        appItem = Instances [key];
55
 
                        } else {
56
 
                                DesktopItem item = null;
57
 
                                try {
58
 
                                        item = DesktopItem.NewFromFile (path, 0);
59
 
                                        appItem = new ApplicationItem (item);
60
 
                                } catch (Exception e) {
61
 
                                        appItem = null;
62
 
                                        try { item.Dispose (); } catch { }
63
 
                                        Log.Error ("Could not load desktop item: {0}", e.Message);
64
 
                                        Log.Debug (e.StackTrace);
 
53
                        lock (Instances)
 
54
                        {
 
55
                                if (Instances.ContainsKey (key)) {
 
56
                                                appItem = Instances [key];
 
57
                                } else {
 
58
                                        DesktopItem item = null;
 
59
                                        try {
 
60
                                                item = DesktopItem.NewFromFile (path, 0);
 
61
                                                appItem = new ApplicationItem (item);
 
62
                                        } catch (Exception e) {
 
63
                                                appItem = null;
 
64
                                                try { item.Dispose (); } catch { }
 
65
                                                Log.Error ("Could not load desktop item: {0}", e.Message);
 
66
                                                Log.Debug (e.StackTrace);
 
67
                                        }
 
68
 
 
69
                                        if (appItem != null)
 
70
                                                Instances [key] = appItem;
65
71
                                }
66
 
 
67
 
                                if (appItem != null)
68
 
                                        Instances [key] = appItem;
69
72
                        }
70
73
                        return appItem;
71
74
                }
121
124
                }
122
125
 
123
126
                protected DesktopItem item;
124
 
                string name, description, icon;
 
127
                string name, description, icon, mimetype;
125
128
                IEnumerable<string> categories;
126
129
 
127
130
                /// <summary>