{"action":"created","comment":{"url":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/comments/72726308","id":72726308,"diff_hunk":"@@ -185,21 +185,61 @@ - (void)selectTriggerInPrefPane:(QSTrigger *)trigger {\n }\n \n - (QSObject *)executeCommand:(QSObject *)dObject afterDelay:(QSObject *)iObject {\n-\tNSTimer *timer = [[NSTimer alloc] initWithFireDate:[NSDate dateWithTimeIntervalSinceNow:QSTimeIntervalForString([iObject stringValue])] interval:0 target:self selector:@selector(runCommand:) userInfo:dObject repeats:NO];\n+\tNSString *taskID = [NSString stringWithFormat:@\"delay-%ld-%ld\", dObject.hash, iObject.hash];\n+\tNSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];\n+\t[dateFormatter setDateStyle:NSDateFormatterShortStyle];\n+\t[dateFormatter setTimeStyle:NSDateFormatterShortStyle];\n+\tQSTask *delayedTask = [QSTask taskWithIdentifier:taskID];\n+\t[delayedTask setName:[dObject displayName]];\n+\t[delayedTask setIcon:[dObject icon]];\n+\t[delayedTask setShowProgress:NO];\n+\tNSDictionary *userInfo = @{\n+\t\t@\"command\": dObject,\n+\t\t@\"task\": delayedTask,\n+\t};\n+\tNSDate *fireDate = [NSDate dateWithTimeIntervalSinceNow:QSTimeIntervalForString([iObject stringValue])];\n+\tNSString *taskStatus = [NSString stringWithFormat:@\"Will run at %@\", [dateFormatter stringFromDate:fireDate]];\n+\t[delayedTask setStatus:taskStatus];\n+\tNSTimer *timer = [[NSTimer alloc] initWithFireDate:fireDate interval:0 target:self selector:@selector(runCommand:) userInfo:userInfo repeats:NO];\n+\t[delayedTask setCancelBlock:^(void){\n+\t\t[timer invalidate];\n+\t}];","path":"Quicksilver/Code-QuickStepCore/QSCommand.m","position":23,"original_position":23,"commit_id":"c96a6fb1d2ebc73dd22cc5099a8d6250e9668cd7","original_commit_id":"c96a6fb1d2ebc73dd22cc5099a8d6250e9668cd7","user":{"login":"pjrobertson","id":150431,"avatar_url":"https://avatars.githubusercontent.com/u/150431?v=3","gravatar_id":"","url":"https://api.github.com/users/pjrobertson","html_url":"https://github.com/pjrobertson","followers_url":"https://api.github.com/users/pjrobertson/followers","following_url":"https://api.github.com/users/pjrobertson/following{/other_user}","gists_url":"https://api.github.com/users/pjrobertson/gists{/gist_id}","starred_url":"https://api.github.com/users/pjrobertson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjrobertson/subscriptions","organizations_url":"https://api.github.com/users/pjrobertson/orgs","repos_url":"https://api.github.com/users/pjrobertson/repos","events_url":"https://api.github.com/users/pjrobertson/events{/privacy}","received_events_url":"https://api.github.com/users/pjrobertson/received_events","type":"User","site_admin":false},"body":"All this code can at least go in another method to keep things DRY right? It's also in  `(QSObject *)executeCommand:(QSObject *)dObject atTime:(QSObject *)iObject `\r\n\r\ne.g. `makeTaskWithDirectCommand: atTime:`\r\n","created_at":"2016-07-29T00:25:05Z","updated_at":"2016-07-29T00:25:05Z","html_url":"https://github.com/quicksilver/Quicksilver/pull/2247#discussion_r72726308","pull_request_url":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/2247","_links":{"self":{"href":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/comments/72726308"},"html":{"href":"https://github.com/quicksilver/Quicksilver/pull/2247#discussion_r72726308"},"pull_request":{"href":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/2247"}}},"pull_request":{"url":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/2247","id":79246724,"html_url":"https://github.com/quicksilver/Quicksilver/pull/2247","diff_url":"https://github.com/quicksilver/Quicksilver/pull/2247.diff","patch_url":"https://github.com/quicksilver/Quicksilver/pull/2247.patch","issue_url":"https://api.github.com/repos/quicksilver/Quicksilver/issues/2247","number":2247,"state":"open","locked":false,"title":"add delayed commands to the task viewer","user":{"login":"skurfer","id":154676,"avatar_url":"https://avatars.githubusercontent.com/u/154676?v=3","gravatar_id":"","url":"https://api.github.com/users/skurfer","html_url":"https://github.com/skurfer","followers_url":"https://api.github.com/users/skurfer/followers","following_url":"https://api.github.com/users/skurfer/following{/other_user}","gists_url":"https://api.github.com/users/skurfer/gists{/gist_id}","starred_url":"https://api.github.com/users/skurfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skurfer/subscriptions","organizations_url":"https://api.github.com/users/skurfer/orgs","repos_url":"https://api.github.com/users/skurfer/repos","events_url":"https://api.github.com/users/skurfer/events{/privacy}","received_events_url":"https://api.github.com/users/skurfer/received_events","type":"User","site_admin":false},"body":"The oldest stash in my repo finally gets set free!\r\n\r\nThis does what I described in #1767.\r\n\r\nThe code isn’t as DRY as I’d like. I made some effort to factor out the task creation, but it’s not that easy. The task needs to know about the timer (for its cancel block) and the timer needs to know about the task (for its user info).","created_at":"2016-07-28T18:41:01Z","updated_at":"2016-07-29T00:25:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2e2d3089843bc5349f7ff5ae9e5f6f04f8d7e49","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/2247/commits","review_comments_url":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/2247/comments","review_comment_url":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quicksilver/Quicksilver/issues/2247/comments","statuses_url":"https://api.github.com/repos/quicksilver/Quicksilver/statuses/c96a6fb1d2ebc73dd22cc5099a8d6250e9668cd7","head":{"label":"quicksilver:timed-tasks","ref":"timed-tasks","sha":"c96a6fb1d2ebc73dd22cc5099a8d6250e9668cd7","user":{"login":"quicksilver","id":499603,"avatar_url":"https://avatars.githubusercontent.com/u/499603?v=3","gravatar_id":"","url":"https://api.github.com/users/quicksilver","html_url":"https://github.com/quicksilver","followers_url":"https://api.github.com/users/quicksilver/followers","following_url":"https://api.github.com/users/quicksilver/following{/other_user}","gists_url":"https://api.github.com/users/quicksilver/gists{/gist_id}","starred_url":"https://api.github.com/users/quicksilver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quicksilver/subscriptions","organizations_url":"https://api.github.com/users/quicksilver/orgs","repos_url":"https://api.github.com/users/quicksilver/repos","events_url":"https://api.github.com/users/quicksilver/events{/privacy}","received_events_url":"https://api.github.com/users/quicksilver/received_events","type":"Organization","site_admin":false},"repo":{"id":358078,"name":"Quicksilver","full_name":"quicksilver/Quicksilver","owner":{"login":"quicksilver","id":499603,"avatar_url":"https://avatars.githubusercontent.com/u/499603?v=3","gravatar_id":"","url":"https://api.github.com/users/quicksilver","html_url":"https://github.com/quicksilver","followers_url":"https://api.github.com/users/quicksilver/followers","following_url":"https://api.github.com/users/quicksilver/following{/other_user}","gists_url":"https://api.github.com/users/quicksilver/gists{/gist_id}","starred_url":"https://api.github.com/users/quicksilver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quicksilver/subscriptions","organizations_url":"https://api.github.com/users/quicksilver/orgs","repos_url":"https://api.github.com/users/quicksilver/repos","events_url":"https://api.github.com/users/quicksilver/events{/privacy}","received_events_url":"https://api.github.com/users/quicksilver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quicksilver/Quicksilver","description":"Quicksilver Mac OS X Project Source","fork":false,"url":"https://api.github.com/repos/quicksilver/Quicksilver","forks_url":"https://api.github.com/repos/quicksilver/Quicksilver/forks","keys_url":"https://api.github.com/repos/quicksilver/Quicksilver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quicksilver/Quicksilver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quicksilver/Quicksilver/teams","hooks_url":"https://api.github.com/repos/quicksilver/Quicksilver/hooks","issue_events_url":"https://api.github.com/repos/quicksilver/Quicksilver/issues/events{/number}","events_url":"https://api.github.com/repos/quicksilver/Quicksilver/events","assignees_url":"https://api.github.com/repos/quicksilver/Quicksilver/assignees{/user}","branches_url":"https://api.github.com/repos/quicksilver/Quicksilver/branches{/branch}","tags_url":"https://api.github.com/repos/quicksilver/Quicksilver/tags","blobs_url":"https://api.github.com/repos/quicksilver/Quicksilver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quicksilver/Quicksilver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quicksilver/Quicksilver/git/refs{/sha}","trees_url":"https://api.github.com/repos/quicksilver/Quicksilver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quicksilver/Quicksilver/statuses/{sha}","languages_url":"https://api.github.com/repos/quicksilver/Quicksilver/languages","stargazers_url":"https://api.github.com/repos/quicksilver/Quicksilver/stargazers","contributors_url":"https://api.github.com/repos/quicksilver/Quicksilver/contributors","subscribers_url":"https://api.github.com/repos/quicksilver/Quicksilver/subscribers","subscription_url":"https://api.github.com/repos/quicksilver/Quicksilver/subscription","commits_url":"https://api.github.com/repos/quicksilver/Quicksilver/commits{/sha}","git_commits_url":"https://api.github.com/repos/quicksilver/Quicksilver/git/commits{/sha}","comments_url":"https://api.github.com/repos/quicksilver/Quicksilver/comments{/number}","issue_comment_url":"https://api.github.com/repos/quicksilver/Quicksilver/issues/comments{/number}","contents_url":"https://api.github.com/repos/quicksilver/Quicksilver/contents/{+path}","compare_url":"https://api.github.com/repos/quicksilver/Quicksilver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quicksilver/Quicksilver/merges","archive_url":"https://api.github.com/repos/quicksilver/Quicksilver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quicksilver/Quicksilver/downloads","issues_url":"https://api.github.com/repos/quicksilver/Quicksilver/issues{/number}","pulls_url":"https://api.github.com/repos/quicksilver/Quicksilver/pulls{/number}","milestones_url":"https://api.github.com/repos/quicksilver/Quicksilver/milestones{/number}","notifications_url":"https://api.github.com/repos/quicksilver/Quicksilver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quicksilver/Quicksilver/labels{/name}","releases_url":"https://api.github.com/repos/quicksilver/Quicksilver/releases{/id}","deployments_url":"https://api.github.com/repos/quicksilver/Quicksilver/deployments","created_at":"2009-11-02T14:55:23Z","updated_at":"2016-07-28T02:55:15Z","pushed_at":"2016-07-28T21:57:57Z","git_url":"git://github.com/quicksilver/Quicksilver.git","ssh_url":"git@github.com:quicksilver/Quicksilver.git","clone_url":"https://github.com/quicksilver/Quicksilver.git","svn_url":"https://github.com/quicksilver/Quicksilver","homepage":"http://qsapp.com","size":125326,"stargazers_count":2037,"watchers_count":2037,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":251,"mirror_url":null,"open_issues_count":329,"forks":251,"open_issues":329,"watchers":2037,"default_branch":"master"}},"base":{"label":"quicksilver:master","ref":"master","sha":"8636c0e4ad4c579deeb323ea7b535ed4771dad84","user":{"login":"quicksilver","id":499603,"avatar_url":"https://avatars.githubusercontent.com/u/499603?v=3","gravatar_id":"","url":"https://api.github.com/users/quicksilver","html_url":"https://github.com/quicksilver","followers_url":"https://api.github.com/users/quicksilver/followers","following_url":"https://api.github.com/users/quicksilver/following{/other_user}","gists_url":"https://api.github.com/users/quicksilver/gists{/gist_id}","starred_url":"https://api.github.com/users/quicksilver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quicksilver/subscriptions","organizations_url":"https://api.github.com/users/quicksilver/orgs","repos_url":"https://api.github.com/users/quicksilver/repos","events_url":"https://api.github.com/users/quicksilver/events{/privacy}","received_events_url":"https://api.github.com/users/quicksilver/received_events","type":"Organization","site_admin":false},"repo":{"id":358078,"name":"Quicksilver","full_name":"quicksilver/Quicksilver","owner":{"login":"quicksilver","id":499603,"avatar_url":"https://avatars.githubusercontent.com/u/499603?v=3","gravatar_id":"","url":"https://api.github.com/users/quicksilver","html_url":"https://github.com/quicksilver","followers_url":"https://api.github.com/users/quicksilver/followers","following_url":"https://api.github.com/users/quicksilver/following{/other_user}","gists_url":"https://api.github.com/users/quicksilver/gists{/gist_id}","starred_url":"https://api.github.com/users/quicksilver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quicksilver/subscriptions","organizations_url":"https://api.github.com/users/quicksilver/orgs","repos_url":"https://api.github.com/users/quicksilver/repos","events_url":"https://api.github.com/users/quicksilver/events{/privacy}","received_events_url":"https://api.github.com/users/quicksilver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quicksilver/Quicksilver","description":"Quicksilver Mac OS X Project Source","fork":false,"url":"https://api.github.com/repos/quicksilver/Quicksilver","forks_url":"https://api.github.com/repos/quicksilver/Quicksilver/forks","keys_url":"https://api.github.com/repos/quicksilver/Quicksilver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quicksilver/Quicksilver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quicksilver/Quicksilver/teams","hooks_url":"https://api.github.com/repos/quicksilver/Quicksilver/hooks","issue_events_url":"https://api.github.com/repos/quicksilver/Quicksilver/issues/events{/number}","events_url":"https://api.github.com/repos/quicksilver/Quicksilver/events","assignees_url":"https://api.github.com/repos/quicksilver/Quicksilver/assignees{/user}","branches_url":"https://api.github.com/repos/quicksilver/Quicksilver/branches{/branch}","tags_url":"https://api.github.com/repos/quicksilver/Quicksilver/tags","blobs_url":"https://api.github.com/repos/quicksilver/Quicksilver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quicksilver/Quicksilver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quicksilver/Quicksilver/git/refs{/sha}","trees_url":"https://api.github.com/repos/quicksilver/Quicksilver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quicksilver/Quicksilver/statuses/{sha}","languages_url":"https://api.github.com/repos/quicksilver/Quicksilver/languages","stargazers_url":"https://api.github.com/repos/quicksilver/Quicksilver/stargazers","contributors_url":"https://api.github.com/repos/quicksilver/Quicksilver/contributors","subscribers_url":"https://api.github.com/repos/quicksilver/Quicksilver/subscribers","subscription_url":"https://api.github.com/repos/quicksilver/Quicksilver/subscription","commits_url":"https://api.github.com/repos/quicksilver/Quicksilver/commits{/sha}","git_commits_url":"https://api.github.com/repos/quicksilver/Quicksilver/git/commits{/sha}","comments_url":"https://api.github.com/repos/quicksilver/Quicksilver/comments{/number}","issue_comment_url":"https://api.github.com/repos/quicksilver/Quicksilver/issues/comments{/number}","contents_url":"https://api.github.com/repos/quicksilver/Quicksilver/contents/{+path}","compare_url":"https://api.github.com/repos/quicksilver/Quicksilver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quicksilver/Quicksilver/merges","archive_url":"https://api.github.com/repos/quicksilver/Quicksilver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quicksilver/Quicksilver/downloads","issues_url":"https://api.github.com/repos/quicksilver/Quicksilver/issues{/number}","pulls_url":"https://api.github.com/repos/quicksilver/Quicksilver/pulls{/number}","milestones_url":"https://api.github.com/repos/quicksilver/Quicksilver/milestones{/number}","notifications_url":"https://api.github.com/repos/quicksilver/Quicksilver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quicksilver/Quicksilver/labels{/name}","releases_url":"https://api.github.com/repos/quicksilver/Quicksilver/releases{/id}","deployments_url":"https://api.github.com/repos/quicksilver/Quicksilver/deployments","created_at":"2009-11-02T14:55:23Z","updated_at":"2016-07-28T02:55:15Z","pushed_at":"2016-07-28T21:57:57Z","git_url":"git://github.com/quicksilver/Quicksilver.git","ssh_url":"git@github.com:quicksilver/Quicksilver.git","clone_url":"https://github.com/quicksilver/Quicksilver.git","svn_url":"https://github.com/quicksilver/Quicksilver","homepage":"http://qsapp.com","size":125326,"stargazers_count":2037,"watchers_count":2037,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":251,"mirror_url":null,"open_issues_count":329,"forks":251,"open_issues":329,"watchers":2037,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/2247"},"html":{"href":"https://github.com/quicksilver/Quicksilver/pull/2247"},"issue":{"href":"https://api.github.com/repos/quicksilver/Quicksilver/issues/2247"},"comments":{"href":"https://api.github.com/repos/quicksilver/Quicksilver/issues/2247/comments"},"review_comments":{"href":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/2247/comments"},"review_comment":{"href":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quicksilver/Quicksilver/pulls/2247/commits"},"statuses":{"href":"https://api.github.com/repos/quicksilver/Quicksilver/statuses/c96a6fb1d2ebc73dd22cc5099a8d6250e9668cd7"}}}}
{"actor":{"display_login":"pjrobertson"}}