Merge lp:~manishsinha/zeitgeist-sharp/fix-651339 into lp:~zeitgeist-sharp/zeitgeist-sharp/trunk

Status: Merged
Merged at revision: 33
Proposed branch: lp:~manishsinha/zeitgeist-sharp/fix-651339
Merge into: lp:~zeitgeist-sharp/zeitgeist-sharp/trunk
Diff against target: 402 lines (+145/-141)
7 files modified
Zeitgeist/Client/IBlacklist.cs (+1/-1)
Zeitgeist/Client/IDataSource.cs (+1/-1)
Zeitgeist/Client/ILog.cs (+1/-1)
Zeitgeist/DataSourceClient.cs (+1/-1)
Zeitgeist/Datamodel/DataSource.cs (+67/-65)
Zeitgeist/Datamodel/Event.cs (+72/-70)
Zeitgeist/ZsUtils.cs (+2/-2)
To merge this branch: bzr merge lp:~manishsinha/zeitgeist-sharp/fix-651339
Reviewer Review Type Date Requested Status
Zeitgeist Sharp Pending
Review via email: mp+37283@code.launchpad.net
To post a comment you must log in.
33. By Manish Sinha (मनीष सिन्हा)

Due to changing of access modifier to internal in last commit a few problems were encountered
Many methods in public classes has internal classes in their method signature which lead to breakage. This commit fixes that problem

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Zeitgeist/Client/IBlacklist.cs'
2--- Zeitgeist/Client/IBlacklist.cs 2010-09-10 20:28:31 +0000
3+++ Zeitgeist/Client/IBlacklist.cs 2010-10-01 16:43:06 +0000
4@@ -10,7 +10,7 @@
5 /// and if they match they will not be inserted in the log, and any matching monitors will not be signalled.
6 /// </summary>
7 [NDesk.DBus.Interface ("org.gnome.zeitgeist.Blacklist")]
8- public interface IBlacklist
9+ internal interface IBlacklist
10 {
11 /// <summary>
12 /// Get the current blacklist templates.
13
14=== modified file 'Zeitgeist/Client/IDataSource.cs'
15--- Zeitgeist/Client/IDataSource.cs 2010-09-10 16:34:11 +0000
16+++ Zeitgeist/Client/IDataSource.cs 2010-10-01 16:43:06 +0000
17@@ -9,7 +9,7 @@
18 /// (components inserting information into Zeitgeist). An option to disable such data-providers is also provided.
19 /// </summary>
20 [NDesk.DBus.Interface ("org.gnome.zeitgeist.DataSourceRegistry")]
21- public interface IDataSource
22+ internal interface IDataSource
23 {
24 /// <summary>
25 /// Get the list of known data-sources.
26
27=== modified file 'Zeitgeist/Client/ILog.cs'
28--- Zeitgeist/Client/ILog.cs 2010-09-10 20:09:19 +0000
29+++ Zeitgeist/Client/ILog.cs 2010-10-01 16:43:06 +0000
30@@ -12,7 +12,7 @@
31 /// All querying is heavily based around an “event template”-concept.
32 /// </summary>
33 [NDesk.DBus.Interface ("org.gnome.zeitgeist.Log")]
34- public interface ILog
35+ internal interface ILog
36 {
37 /// <summary>
38 /// Get full event data for a set of event IDs
39
40=== modified file 'Zeitgeist/DataSourceClient.cs'
41--- Zeitgeist/DataSourceClient.cs 2010-09-10 22:21:31 +0000
42+++ Zeitgeist/DataSourceClient.cs 2010-10-01 16:43:06 +0000
43@@ -64,7 +64,7 @@
44
45 foreach(RawDataSource src in srcs)
46 {
47- DataSource et = DataSource.FromRaw(src);
48+ DataSource et = RawDataSource.FromRaw(src);
49 srcList.Add(et);
50 }
51
52
53=== modified file 'Zeitgeist/Datamodel/DataSource.cs'
54--- Zeitgeist/Datamodel/DataSource.cs 2010-09-10 20:09:19 +0000
55+++ Zeitgeist/Datamodel/DataSource.cs 2010-10-01 16:43:06 +0000
56@@ -66,77 +66,13 @@
57 get;set;
58 }
59
60- /// <summary>
61- /// Convert an object of type RawDataSource to DataSource
62- /// </summary>
63- /// <param name="raw">
64- /// An instance of RawDataSource <see cref="RawDataSource"/>
65- /// </param>
66- /// <returns>
67- /// An instance of DataSource <see cref="DataSource"/>
68- /// </returns>
69- public static DataSource FromRaw(RawDataSource raw)
70- {
71- DataSource src = new DataSource();
72-
73- src.UniqueId = raw.UniqueId;
74- src.Name = raw.Name;
75- src.Description = raw.Description;
76- src.Running = raw.Running;
77- src.LastSeen = long.Parse(raw.LastSeen.ToString());
78- src.Enabled = raw.Enabled;
79-
80- if(raw.RawEvents != null)
81- {
82- src.Events = new List<Event>();
83- foreach(RawEvent evn in raw.RawEvents)
84- {
85- Event ev = Event.FromRaw(evn);
86- src.Events.Add(ev);
87- }
88- }
89-
90- return src;
91- }
92
93- /// <summary>
94- /// Convert an object of type DataSource to RawDataSource
95- /// </summary>
96- /// <param name="src">
97- /// An instance of DataSource <see cref="Zeitgeist.Datamodel.DataSource"/>
98- /// </param>
99- /// <returns>
100- /// An instance of RawDataSource <see cref="Zeitgeist.Datamodel.RawDataSource"/>
101- /// </returns>
102- public static RawDataSource ToRaw(DataSource src)
103- {
104- RawDataSource raw = new RawDataSource();
105-
106- raw.UniqueId = src.UniqueId;
107- raw.Name = src.Name;
108- raw.Description = src.Description;
109- raw.Running = src.Running;
110- raw.LastSeen = UInt64.Parse(src.LastSeen.ToString());
111- raw.Enabled = src.Enabled;
112-
113- if(raw.RawEvents != null)
114- {
115- List<RawEvent> events = new List<RawEvent>();
116- foreach(Event evn in src.Events)
117- {
118- RawEvent ev = evn.GetRawEvent();
119- events.Add(ev);
120- }
121- }
122-
123- return raw;
124- }
125 }
126
127 /// <summary>
128 /// A raw DBus based representation of Event
129 /// </summary>
130- public struct RawDataSource
131+ internal struct RawDataSource
132 {
133 /// <summary>
134 /// The Id of the RawDataSource
135@@ -279,6 +215,72 @@
136 Enabled = enabled;
137 }
138
139+ /// <summary>
140+ /// Convert an object of type RawDataSource to DataSource
141+ /// </summary>
142+ /// <param name="raw">
143+ /// An instance of RawDataSource <see cref="RawDataSource"/>
144+ /// </param>
145+ /// <returns>
146+ /// An instance of DataSource <see cref="DataSource"/>
147+ /// </returns>
148+ public static DataSource FromRaw(RawDataSource raw)
149+ {
150+ DataSource src = new DataSource();
151+
152+ src.UniqueId = raw.UniqueId;
153+ src.Name = raw.Name;
154+ src.Description = raw.Description;
155+ src.Running = raw.Running;
156+ src.LastSeen = long.Parse(raw.LastSeen.ToString());
157+ src.Enabled = raw.Enabled;
158+
159+ if(raw.RawEvents != null)
160+ {
161+ src.Events = new List<Event>();
162+ foreach(RawEvent evn in raw.RawEvents)
163+ {
164+ Event ev = RawEvent.FromRaw(evn);
165+ src.Events.Add(ev);
166+ }
167+ }
168+
169+ return src;
170+ }
171+
172+ /// <summary>
173+ /// Convert an object of type DataSource to RawDataSource
174+ /// </summary>
175+ /// <param name="src">
176+ /// An instance of DataSource <see cref="Zeitgeist.Datamodel.DataSource"/>
177+ /// </param>
178+ /// <returns>
179+ /// An instance of RawDataSource <see cref="Zeitgeist.Datamodel.RawDataSource"/>
180+ /// </returns>
181+ public static RawDataSource ToRaw(DataSource src)
182+ {
183+ RawDataSource raw = new RawDataSource();
184+
185+ raw.UniqueId = src.UniqueId;
186+ raw.Name = src.Name;
187+ raw.Description = src.Description;
188+ raw.Running = src.Running;
189+ raw.LastSeen = UInt64.Parse(src.LastSeen.ToString());
190+ raw.Enabled = src.Enabled;
191+
192+ if(raw.RawEvents != null)
193+ {
194+ List<RawEvent> events = new List<RawEvent>();
195+ foreach(Event evn in src.Events)
196+ {
197+ RawEvent ev = evn.GetRawEvent();
198+ events.Add(ev);
199+ }
200+ }
201+
202+ return raw;
203+ }
204+
205 #region Private Fields
206
207 private string _uniqueId;
208
209=== modified file 'Zeitgeist/Datamodel/Event.cs'
210--- Zeitgeist/Datamodel/Event.cs 2010-09-19 14:20:33 +0000
211+++ Zeitgeist/Datamodel/Event.cs 2010-10-01 16:43:06 +0000
212@@ -82,74 +82,7 @@
213 get;set;
214 }
215
216- /// <summary>
217- /// Create a Event from a RawEvent
218- /// </summary>
219- /// <param name="raw">
220- /// The instance of the RawEvent <see cref="RawEvent"/>
221- /// </param>
222- /// <returns>
223- /// The instance of an Event <see cref="Event"/>
224- /// </returns>
225- public static Event FromRaw(RawEvent raw)
226- {
227- Event e = new Event();
228-
229- if(raw.metadata.Length != Enum.GetNames(typeof(EventMetadataPosition)).Length)
230- return null;
231-
232- #region Metadata
233-
234- ulong id;
235- UInt64.TryParse(raw.metadata[(int)EventMetadataPosition.Id], out id);
236- e.Id = id;
237-
238- ulong timestamp;
239- UInt64.TryParse(raw.metadata[(int)EventMetadataPosition.Timestamp], out timestamp);
240- e.Timestamp = ZsUtils.ToDateTime(timestamp);
241-
242- e.Actor = raw.metadata[(int)EventMetadataPosition.Actor];
243-
244- string _interpretation = raw.metadata[(int)EventMetadataPosition.Interpretation];
245- string _manifestation = raw.metadata[(int)EventMetadataPosition.Manifestation];
246- e.Interpretation = Zeitgeist.Datamodel.Interpretation.Instance.Search(_interpretation);
247- e.Manifestation = Zeitgeist.Datamodel.Manifestation.Instance.Search(_manifestation);
248-
249- #endregion
250-
251- #region Subjects
252-
253- e.Subjects= new List<Subject>();
254-
255- for(int i = 0; i < raw.subjects.Length; i ++)
256- {
257- Subject sub = new Subject();
258- string[] subjArr = raw.subjects[i];
259-
260- sub.Uri = subjArr[(int)EventSubjectPosition.Uri];
261- sub.Origin = subjArr[(int)EventSubjectPosition.Origin];
262- sub.MimeType = subjArr[(int)EventSubjectPosition.Mimetype];
263- sub.Text = subjArr[(int)EventSubjectPosition.Text];
264- sub.Storage = subjArr[(int)EventSubjectPosition.Storage];
265-
266- string sub_interpretation = subjArr[(int)EventSubjectPosition.Interpretation];
267- string sub_manifestation = subjArr[(int)EventSubjectPosition.Manifestation];
268- sub.Interpretation = Zeitgeist.Datamodel.Interpretation.Instance.Search(sub_interpretation);
269- sub.Manifestation = Zeitgeist.Datamodel.Manifestation.Instance.Search(sub_manifestation);
270-
271- e.Subjects.Add(sub);
272- }
273-
274- #endregion
275-
276- #region Payload
277-
278- e.Payload = raw.payload;
279-
280- #endregion
281-
282- return e;
283- }
284+
285
286 /// <summary>
287 /// Get the RawEvent for this Event
288@@ -157,7 +90,7 @@
289 /// <returns>
290 /// The RawEvent instance generated from the current Event <see cref="RawEvent"/>
291 /// </returns>
292- public RawEvent GetRawEvent()
293+ internal RawEvent GetRawEvent()
294 {
295 return RawEvent.FromEvent(this);
296 }
297@@ -166,7 +99,7 @@
298 /// <summary>
299 /// The Raw form of Event. Get Event.FromRaw to create an Event from a RawEvent
300 /// </summary>
301- public struct RawEvent
302+ internal struct RawEvent
303 {
304 /// <summary>
305 /// The event Metadata
306@@ -309,6 +242,75 @@
307 return raw;
308 }
309
310+ /// <summary>
311+ /// Create a Event from a RawEvent
312+ /// </summary>
313+ /// <param name="raw">
314+ /// The instance of the RawEvent <see cref="RawEvent"/>
315+ /// </param>
316+ /// <returns>
317+ /// The instance of an Event <see cref="Event"/>
318+ /// </returns>
319+ public static Event FromRaw(RawEvent raw)
320+ {
321+ Event e = new Event();
322+
323+ if(raw.metadata.Length != Enum.GetNames(typeof(EventMetadataPosition)).Length)
324+ return null;
325+
326+ #region Metadata
327+
328+ ulong id;
329+ UInt64.TryParse(raw.metadata[(int)EventMetadataPosition.Id], out id);
330+ e.Id = id;
331+
332+ ulong timestamp;
333+ UInt64.TryParse(raw.metadata[(int)EventMetadataPosition.Timestamp], out timestamp);
334+ e.Timestamp = ZsUtils.ToDateTime(timestamp);
335+
336+ e.Actor = raw.metadata[(int)EventMetadataPosition.Actor];
337+
338+ string _interpretation = raw.metadata[(int)EventMetadataPosition.Interpretation];
339+ string _manifestation = raw.metadata[(int)EventMetadataPosition.Manifestation];
340+ e.Interpretation = Zeitgeist.Datamodel.Interpretation.Instance.Search(_interpretation);
341+ e.Manifestation = Zeitgeist.Datamodel.Manifestation.Instance.Search(_manifestation);
342+
343+ #endregion
344+
345+ #region Subjects
346+
347+ e.Subjects= new List<Subject>();
348+
349+ for(int i = 0; i < raw.subjects.Length; i ++)
350+ {
351+ Subject sub = new Subject();
352+ string[] subjArr = raw.subjects[i];
353+
354+ sub.Uri = subjArr[(int)EventSubjectPosition.Uri];
355+ sub.Origin = subjArr[(int)EventSubjectPosition.Origin];
356+ sub.MimeType = subjArr[(int)EventSubjectPosition.Mimetype];
357+ sub.Text = subjArr[(int)EventSubjectPosition.Text];
358+ sub.Storage = subjArr[(int)EventSubjectPosition.Storage];
359+
360+ string sub_interpretation = subjArr[(int)EventSubjectPosition.Interpretation];
361+ string sub_manifestation = subjArr[(int)EventSubjectPosition.Manifestation];
362+ sub.Interpretation = Zeitgeist.Datamodel.Interpretation.Instance.Search(sub_interpretation);
363+ sub.Manifestation = Zeitgeist.Datamodel.Manifestation.Instance.Search(sub_manifestation);
364+
365+ e.Subjects.Add(sub);
366+ }
367+
368+ #endregion
369+
370+ #region Payload
371+
372+ e.Payload = raw.payload;
373+
374+ #endregion
375+
376+ return e;
377+ }
378+
379 #region RawEvent Private Fields
380
381 private string[] _metadata;
382
383=== modified file 'Zeitgeist/ZsUtils.cs'
384--- Zeitgeist/ZsUtils.cs 2010-09-19 14:20:33 +0000
385+++ Zeitgeist/ZsUtils.cs 2010-10-01 16:43:06 +0000
386@@ -6,7 +6,7 @@
387
388 namespace Zeitgeist
389 {
390- public class ZsUtils
391+ internal class ZsUtils
392 {
393 #region Event <--> RawEvent Conversions
394
395@@ -47,7 +47,7 @@
396
397 foreach(RawEvent rawEvent in rawEvents)
398 {
399- Event evnt = Event.FromRaw(rawEvent);
400+ Event evnt = RawEvent.FromRaw(rawEvent);
401 events.Add(evnt);
402 }
403

Subscribers

People subscribed via source and target branches