Do

Merge lp:~cszikszoy/do/contactitem-remove into lp:do

Proposed by Chris S.
Status: Rejected
Rejected by: Alex Launi
Proposed branch: lp:~cszikszoy/do/contactitem-remove
Merge into: lp:do
Diff against target: None lines
To merge this branch: bzr merge lp:~cszikszoy/do/contactitem-remove
Reviewer Review Type Date Requested Status
Alex Launi (community) Disapprove
Review via email: mp+4490@code.launchpad.net
To post a comment you must log in.
lp:~cszikszoy/do/contactitem-remove updated
1095. By Chris S.

add function to merge contacts

Revision history for this message
Alex Launi (alexlauni) wrote :

I don't see this as a useful feature. Do already merges contacts with the same name, if you want them merged you should so in the application. This also breaks a central part of the Do philosophy which is that you should never be using Do to use Do. Do should always be a means to another end. If an ItemSource does not allow you to set an alias for a contact then that's a bug in the application and should be fixed upstream. We shouldn't break the zen of Do for these unwieldy applications.

review: Disapprove

Unmerged revisions

1095. By Chris S.

add function to merge contacts

1094. By Chris S.

add function to check if contact exists

1093. By Chris S.

allow for the removal of a contact item

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Do.Universe/src/Do.Universe/ContactItem.cs'
2--- Do.Universe/src/Do.Universe/ContactItem.cs 2008-12-20 00:31:54 +0000
3+++ Do.Universe/src/Do.Universe/ContactItem.cs 2009-03-14 09:53:44 +0000
4@@ -57,6 +57,30 @@
5 }
6 return contact;
7 }
8+
9+ public static bool RemoveContact (ContactItem contact)
10+ {
11+ return RemoveContact (contact["name"].ToLower ());
12+ }
13+
14+ public static bool RemoveContact (string name)
15+ {
16+ if (Exists (name)) {
17+ return (contacts_name.Remove (name)) ? true : false;
18+ }
19+ else
20+ return false;
21+ }
22+
23+ public static bool Exists (ContactItem contact)
24+ {
25+ return Exists (contact["name"].ToLower ());
26+ }
27+
28+ public static bool Exists (string name)
29+ {
30+ return contacts_name.ContainsKey (name);
31+ }
32
33 protected Dictionary<string,string> details;
34