public
Fork of Caged/gitnub
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/eventualbuddha/gitnub.git
Search Repo:
Added support for simple synchronously cached icons.
benstiglitz (author)
Wed Mar 12 14:05:31 -0700 2008
commit  210a3f374d94d5bc36e15cbe227f3132dbdbabb1
tree    af75b40a654f7d1a69705c859c70301b2737e676
parent  52ba1b1cbda0c8d62819ea6aec11fb898f890d82
...
21
22
23
24
 
 
 
 
25
26
27
...
101
102
103
104
105
106
107
108
109
 
110
111
112
...
21
22
23
 
24
25
26
27
28
29
30
...
104
105
106
 
 
 
 
 
 
107
108
109
110
0
@@ -21,7 +21,10 @@ class CommitsController < OSX::NSObject
0
     @current_commit_offset = 0
0
     @offset = 50
0
     @active_commit = nil
0
- @icons = {}
0
+ @icons = Hash.new do |hash, email|
0
+ gravatar = NSURL.URLWithString("http://www.gravatar.com/avatar.php?gravatar_id=#{MD5.hexdigest(email)}&size=36")
0
+ hash[email] = NSImage.alloc.initWithContentsOfURL(gravatar)
0
+ end
0
     
0
     if(fetch_git_repository)
0
       setup_commit_detail_view
0
@@ -101,12 +104,7 @@ class CommitsController < OSX::NSObject
0
   end
0
   
0
   def iconForCell_data(icon, data)
0
- #request = NSURLRequest.requestWithURL(NSURL.URLWithString("http://www.gravatar.com/avatar.php?gravatar_id=#{MD5.hexdigest(data.committer.email)}&size=36"))
0
- #connection = NSURLConnection.alloc.initWithRequest_delegate(request, self)
0
- @image_data = NSMutableData.data
0
- gravatar = NSURL.URLWithString("http://www.gravatar.com/avatar.php?gravatar_id=#{MD5.hexdigest(data.committer.email)}&size=36")
0
- NSImage.alloc.initWithContentsOfURL(gravatar)
0
- #@icons[MD5.hexdigest(data.committer.email)] = NSImage.alloc.initWithData(@image_data)
0
+ @icons[data.committer.email]
0
   end
0
   
0
   def dataElementForCell(cell)

Comments

    No one has commented yet.